Skip to content

Commit

Permalink
Batch appercase hex values
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Oct 16, 2020
1 parent 454f9d6 commit 5070fae
Show file tree
Hide file tree
Showing 106 changed files with 7,192 additions and 7,192 deletions.
2 changes: 1 addition & 1 deletion Marlin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ ifeq ($(HARDWARE_VARIANT), Teensy)

else ifeq ($(HARDWARE_VARIANT), archim)
CDEFS += -DARDUINO_SAM_ARCHIM -DARDUINO_ARCH_SAM -D__SAM3X8E__
CDEFS += -DUSB_VID=0x27b1 -DUSB_PID=0x0001 -DUSBCON
CDEFS += -DUSB_VID=0x27B1 -DUSB_PID=0x0001 -DUSBCON
CDEFS += '-DUSB_MANUFACTURER="UltiMachine"' '-DUSB_PRODUCT_STRING="Archim"'

LIB_CXXSRC += variant.cpp IPAddress.cpp Reset.cpp RingBuffer.cpp Stream.cpp \
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/HAL/AVR/fast_pwm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ void set_pwm_frequency(const pin_t pin, int f_desired) {
res_temp_phase_correct = rtf / 2;
}

LIMIT(res_temp_fast, 1u, size);
LIMIT(res_temp_phase_correct, 1u, size);
LIMIT(res_temp_fast, 1U, size);
LIMIT(res_temp_phase_correct, 1U, size);
// Calculate frequencies of test prescaler and resolution values
const int f_temp_fast = (F_CPU) / (prescaler[i] * (1 + res_temp_fast)),
f_temp_phase_correct = (F_CPU) / (2 * prescaler[i] * res_temp_phase_correct),
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/DUE/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ inline void HAL_reboot() {} // reboot the board or restart the bootloader
extern uint16_t HAL_adc_result; // result of last ADC conversion

#ifndef analogInputToDigitalPin
#define analogInputToDigitalPin(p) ((p < 12u) ? (p) + 54u : -1)
#define analogInputToDigitalPin(p) ((p < 12U) ? (p) + 54U : -1)
#endif

#define HAL_ANALOG_SELECT(ch)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/DUE/eeprom_flash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
#define EEPROMSize 4096
#define PagesPerGroup 128
#define GroupCount 2
#define PageSize 256u
#define PageSize 256U

/* Flash storage */
typedef struct FLASH_SECTOR {
Expand Down
126 changes: 63 additions & 63 deletions Marlin/src/HAL/DUE/usb/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -609,37 +609,37 @@ typedef struct
# define clz(u) ((u) ? __CLZ(u) : 32)
#else
# define clz(u) (((u) == 0) ? 32 : \
((u) & (1ul << 31)) ? 0 : \
((u) & (1ul << 30)) ? 1 : \
((u) & (1ul << 29)) ? 2 : \
((u) & (1ul << 28)) ? 3 : \
((u) & (1ul << 27)) ? 4 : \
((u) & (1ul << 26)) ? 5 : \
((u) & (1ul << 25)) ? 6 : \
((u) & (1ul << 24)) ? 7 : \
((u) & (1ul << 23)) ? 8 : \
((u) & (1ul << 22)) ? 9 : \
((u) & (1ul << 21)) ? 10 : \
((u) & (1ul << 20)) ? 11 : \
((u) & (1ul << 19)) ? 12 : \
((u) & (1ul << 18)) ? 13 : \
((u) & (1ul << 17)) ? 14 : \
((u) & (1ul << 16)) ? 15 : \
((u) & (1ul << 15)) ? 16 : \
((u) & (1ul << 14)) ? 17 : \
((u) & (1ul << 13)) ? 18 : \
((u) & (1ul << 12)) ? 19 : \
((u) & (1ul << 11)) ? 20 : \
((u) & (1ul << 10)) ? 21 : \
((u) & (1ul << 9)) ? 22 : \
((u) & (1ul << 8)) ? 23 : \
((u) & (1ul << 7)) ? 24 : \
((u) & (1ul << 6)) ? 25 : \
((u) & (1ul << 5)) ? 26 : \
((u) & (1ul << 4)) ? 27 : \
((u) & (1ul << 3)) ? 28 : \
((u) & (1ul << 2)) ? 29 : \
((u) & (1ul << 1)) ? 30 : \
((u) & (1UL << 31)) ? 0 : \
((u) & (1UL << 30)) ? 1 : \
((u) & (1UL << 29)) ? 2 : \
((u) & (1UL << 28)) ? 3 : \
((u) & (1UL << 27)) ? 4 : \
((u) & (1UL << 26)) ? 5 : \
((u) & (1UL << 25)) ? 6 : \
((u) & (1UL << 24)) ? 7 : \
((u) & (1UL << 23)) ? 8 : \
((u) & (1UL << 22)) ? 9 : \
((u) & (1UL << 21)) ? 10 : \
((u) & (1UL << 20)) ? 11 : \
((u) & (1UL << 19)) ? 12 : \
((u) & (1UL << 18)) ? 13 : \
((u) & (1UL << 17)) ? 14 : \
((u) & (1UL << 16)) ? 15 : \
((u) & (1UL << 15)) ? 16 : \
((u) & (1UL << 14)) ? 17 : \
((u) & (1UL << 13)) ? 18 : \
((u) & (1UL << 12)) ? 19 : \
((u) & (1UL << 11)) ? 20 : \
((u) & (1UL << 10)) ? 21 : \
((u) & (1UL << 9)) ? 22 : \
((u) & (1UL << 8)) ? 23 : \
((u) & (1UL << 7)) ? 24 : \
((u) & (1UL << 6)) ? 25 : \
((u) & (1UL << 5)) ? 26 : \
((u) & (1UL << 4)) ? 27 : \
((u) & (1UL << 3)) ? 28 : \
((u) & (1UL << 2)) ? 29 : \
((u) & (1UL << 1)) ? 30 : \
31)
#endif
#endif
Expand All @@ -654,38 +654,38 @@ typedef struct
#if (defined __GNUC__) || (defined __CC_ARM)
# define ctz(u) ((u) ? __builtin_ctz(u) : 32)
#else
# define ctz(u) ((u) & (1ul << 0) ? 0 : \
(u) & (1ul << 1) ? 1 : \
(u) & (1ul << 2) ? 2 : \
(u) & (1ul << 3) ? 3 : \
(u) & (1ul << 4) ? 4 : \
(u) & (1ul << 5) ? 5 : \
(u) & (1ul << 6) ? 6 : \
(u) & (1ul << 7) ? 7 : \
(u) & (1ul << 8) ? 8 : \
(u) & (1ul << 9) ? 9 : \
(u) & (1ul << 10) ? 10 : \
(u) & (1ul << 11) ? 11 : \
(u) & (1ul << 12) ? 12 : \
(u) & (1ul << 13) ? 13 : \
(u) & (1ul << 14) ? 14 : \
(u) & (1ul << 15) ? 15 : \
(u) & (1ul << 16) ? 16 : \
(u) & (1ul << 17) ? 17 : \
(u) & (1ul << 18) ? 18 : \
(u) & (1ul << 19) ? 19 : \
(u) & (1ul << 20) ? 20 : \
(u) & (1ul << 21) ? 21 : \
(u) & (1ul << 22) ? 22 : \
(u) & (1ul << 23) ? 23 : \
(u) & (1ul << 24) ? 24 : \
(u) & (1ul << 25) ? 25 : \
(u) & (1ul << 26) ? 26 : \
(u) & (1ul << 27) ? 27 : \
(u) & (1ul << 28) ? 28 : \
(u) & (1ul << 29) ? 29 : \
(u) & (1ul << 30) ? 30 : \
(u) & (1ul << 31) ? 31 : \
# define ctz(u) ((u) & (1UL << 0) ? 0 : \
(u) & (1UL << 1) ? 1 : \
(u) & (1UL << 2) ? 2 : \
(u) & (1UL << 3) ? 3 : \
(u) & (1UL << 4) ? 4 : \
(u) & (1UL << 5) ? 5 : \
(u) & (1UL << 6) ? 6 : \
(u) & (1UL << 7) ? 7 : \
(u) & (1UL << 8) ? 8 : \
(u) & (1UL << 9) ? 9 : \
(u) & (1UL << 10) ? 10 : \
(u) & (1UL << 11) ? 11 : \
(u) & (1UL << 12) ? 12 : \
(u) & (1UL << 13) ? 13 : \
(u) & (1UL << 14) ? 14 : \
(u) & (1UL << 15) ? 15 : \
(u) & (1UL << 16) ? 16 : \
(u) & (1UL << 17) ? 17 : \
(u) & (1UL << 18) ? 18 : \
(u) & (1UL << 19) ? 19 : \
(u) & (1UL << 20) ? 20 : \
(u) & (1UL << 21) ? 21 : \
(u) & (1UL << 22) ? 22 : \
(u) & (1UL << 23) ? 23 : \
(u) & (1UL << 24) ? 24 : \
(u) & (1UL << 25) ? 25 : \
(u) & (1UL << 26) ? 26 : \
(u) & (1UL << 27) ? 27 : \
(u) & (1UL << 28) ? 28 : \
(u) & (1UL << 29) ? 29 : \
(u) & (1UL << 30) ? 30 : \
(u) & (1UL << 31) ? 31 : \
32)
#endif
#endif
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/HAL/ESP32/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,14 @@ FORCE_INLINE static void DELAY_CYCLES(uint32_t x) {

if (stop >= start) {
// no overflow, so only loop while in between start and stop:
// 0x00000000 -----------------start****stop-- 0xffffffff
// 0x00000000 -----------------start****stop-- 0xFFFFFFFF
while (ccount >= start && ccount < stop) {
__asm__ __volatile__ ( "rsr %0, ccount" : "=a" (ccount) );
}
}
else {
// stop did overflow, so only loop while outside of stop and start:
// 0x00000000 **stop-------------------start** 0xffffffff
// 0x00000000 **stop-------------------start** 0xFFFFFFFF
while (ccount >= start || ccount < stop) {
__asm__ __volatile__ ( "rsr %0, ccount" : "=a" (ccount) );
}
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/SAMD51/QSPIFlash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include "QSPIFlash.h"

#define INVALID_ADDR 0xffffffff
#define INVALID_ADDR 0xFFFFFFFF
#define SECTOR_OF(a) (a & ~(SFLASH_SECTOR_SIZE - 1))
#define OFFSET_OF(a) (a & (SFLASH_SECTOR_SIZE - 1))

Expand Down
58 changes: 29 additions & 29 deletions Marlin/src/HAL/STM32_F4_F7/STM32F7/TMC2660.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
#define DEFAULT_MICROSTEPPING_VALUE 32

//TMC26X register definitions
#define DRIVER_CONTROL_REGISTER 0x0ul
#define CHOPPER_CONFIG_REGISTER 0x80000ul
#define DRIVER_CONTROL_REGISTER 0x0UL
#define CHOPPER_CONFIG_REGISTER 0x80000UL
#define COOL_STEP_REGISTER 0xA0000ul
#define STALL_GUARD2_LOAD_MEASURE_REGISTER 0xC0000ul
#define DRIVER_CONFIG_REGISTER 0xE0000ul
Expand All @@ -55,58 +55,58 @@

//definitions for the driver control register
#define MICROSTEPPING_PATTERN 0xFul
#define STEP_INTERPOLATION 0x200ul
#define DOUBLE_EDGE_STEP 0x100ul
#define VSENSE 0x40ul
#define READ_MICROSTEP_POSTION 0x0ul
#define READ_STALL_GUARD_READING 0x10ul
#define READ_STALL_GUARD_AND_COOL_STEP 0x20ul
#define READ_SELECTION_PATTERN 0x30ul
#define STEP_INTERPOLATION 0x200UL
#define DOUBLE_EDGE_STEP 0x100UL
#define VSENSE 0x40UL
#define READ_MICROSTEP_POSTION 0x0UL
#define READ_STALL_GUARD_READING 0x10UL
#define READ_STALL_GUARD_AND_COOL_STEP 0x20UL
#define READ_SELECTION_PATTERN 0x30UL

//definitions for the chopper config register
#define CHOPPER_MODE_STANDARD 0x0ul
#define CHOPPER_MODE_T_OFF_FAST_DECAY 0x4000ul
#define CHOPPER_MODE_STANDARD 0x0UL
#define CHOPPER_MODE_T_OFF_FAST_DECAY 0x4000UL
#define T_OFF_PATTERN 0xFul
#define RANDOM_TOFF_TIME 0x2000ul
#define BLANK_TIMING_PATTERN 0x18000ul
#define RANDOM_TOFF_TIME 0x2000UL
#define BLANK_TIMING_PATTERN 0x18000UL
#define BLANK_TIMING_SHIFT 15
#define HYSTERESIS_DECREMENT_PATTERN 0x1800ul
#define HYSTERESIS_DECREMENT_PATTERN 0x1800UL
#define HYSTERESIS_DECREMENT_SHIFT 11
#define HYSTERESIS_LOW_VALUE_PATTERN 0x780ul
#define HYSTERESIS_LOW_VALUE_PATTERN 0x780UL
#define HYSTERESIS_LOW_SHIFT 7
#define HYSTERESIS_START_VALUE_PATTERN 0x78ul
#define HYSTERESIS_START_VALUE_PATTERN 0x78UL
#define HYSTERESIS_START_VALUE_SHIFT 4
#define T_OFF_TIMING_PATERN 0xFul

//definitions for cool step register
#define MINIMUM_CURRENT_FOURTH 0x8000ul
#define CURRENT_DOWN_STEP_SPEED_PATTERN 0x6000ul
#define MINIMUM_CURRENT_FOURTH 0x8000UL
#define CURRENT_DOWN_STEP_SPEED_PATTERN 0x6000UL
#define SE_MAX_PATTERN 0xF00ul
#define SE_CURRENT_STEP_WIDTH_PATTERN 0x60ul
#define SE_CURRENT_STEP_WIDTH_PATTERN 0x60UL
#define SE_MIN_PATTERN 0xFul

//definitions for StallGuard2 current register
#define STALL_GUARD_FILTER_ENABLED 0x10000ul
#define STALL_GUARD_FILTER_ENABLED 0x10000UL
#define STALL_GUARD_TRESHHOLD_VALUE_PATTERN 0x17F00ul
#define CURRENT_SCALING_PATTERN 0x1Ful
#define STALL_GUARD_CONFIG_PATTERN 0x17F00ul
#define STALL_GUARD_VALUE_PATTERN 0x7F00ul

//definitions for the input from the TMC2660
#define STATUS_STALL_GUARD_STATUS 0x1ul
#define STATUS_OVER_TEMPERATURE_SHUTDOWN 0x2ul
#define STATUS_OVER_TEMPERATURE_WARNING 0x4ul
#define STATUS_SHORT_TO_GROUND_A 0x8ul
#define STATUS_SHORT_TO_GROUND_B 0x10ul
#define STATUS_OPEN_LOAD_A 0x20ul
#define STATUS_OPEN_LOAD_B 0x40ul
#define STATUS_STAND_STILL 0x80ul
#define STATUS_STALL_GUARD_STATUS 0x1UL
#define STATUS_OVER_TEMPERATURE_SHUTDOWN 0x2UL
#define STATUS_OVER_TEMPERATURE_WARNING 0x4UL
#define STATUS_SHORT_TO_GROUND_A 0x8UL
#define STATUS_SHORT_TO_GROUND_B 0x10UL
#define STATUS_OPEN_LOAD_A 0x20UL
#define STATUS_OPEN_LOAD_B 0x40UL
#define STATUS_STAND_STILL 0x80UL
#define READOUT_VALUE_PATTERN 0xFFC00ul

#define CPU_32_BIT

//default values
#define INITIAL_MICROSTEPPING 0x3ul //32th microstepping
#define INITIAL_MICROSTEPPING 0x3UL //32th microstepping

SPIClass SPI_6(SPI6, SPI6_MOSI_PIN, SPI6_MISO_PIN, SPI6_SCK_PIN);

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/TEENSY31_32/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
typedef int8_t pin_t;

#ifndef analogInputToDigitalPin
#define analogInputToDigitalPin(p) ((p < 12u) ? (p) + 54u : -1)
#define analogInputToDigitalPin(p) ((p < 12U) ? (p) + 54U : -1)
#endif

#define CRITICAL_SECTION_START() uint32_t primask = __get_PRIMASK(); __disable_irq()
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/TEENSY35_36/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
typedef int8_t pin_t;

#ifndef analogInputToDigitalPin
#define analogInputToDigitalPin(p) ((p < 12u) ? (p) + 54u : -1)
#define analogInputToDigitalPin(p) ((p < 12U) ? (p) + 54U : -1)
#endif

#define CRITICAL_SECTION_START() uint32_t primask = __get_primask(); __disable_irq()
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/TEENSY40_41/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
typedef int8_t pin_t;

#ifndef analogInputToDigitalPin
#define analogInputToDigitalPin(p) ((p < 12u) ? (p) + 54u : -1)
#define analogInputToDigitalPin(p) ((p < 12U) ? (p) + 54U : -1)
#endif

#define CRITICAL_SECTION_START() uint32_t primask = __get_primask(); __disable_irq()
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/dac/dac_mcp4728.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#endif

#ifndef lowByte
#define lowByte(w) ((uint8_t) ((w) & 0xff))
#define lowByte(w) ((uint8_t) ((w) & 0xFF))
#endif

#ifndef highByte
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/tmc_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#define CHOPPER_09STEP_24V { 3, -1, 5 }

#if ENABLED(MONITOR_DRIVER_STATUS) && !defined(MONITOR_DRIVER_STATUS_INTERVAL_MS)
#define MONITOR_DRIVER_STATUS_INTERVAL_MS 500u
#define MONITOR_DRIVER_STATUS_INTERVAL_MS 500U
#endif

constexpr uint16_t _tmc_thrs(const uint16_t msteps, const uint32_t thrs, const uint32_t spmm) {
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,8 @@ static const TFTGLCD_charmap_t g_TFTGLCD_charmap_device[] PROGMEM = {

#ifdef CONVERT_TO_EXT_ASCII
{IV('°'), 0x01, 0}, // 00B0, Marlin special: '°' LCD_STR_DEGREE (0x09)
{IV('²'), 0x0e, 0}, // 0x32 if no special symbol in panel font
{IV('³'), 0x0f, 0}, // 0x33 if no special symbol in panel font
{IV('²'), 0x0E, 0}, // 0x32 if no special symbol in panel font
{IV('³'), 0x0F, 0}, // 0x33 if no special symbol in panel font

// translate to cp866 codepage
//first ASCII symbols in panel font must be replaced with Marlin special symbols
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/TFTGLCD/ultralcd_TFTGLCD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ TFTGLCD lcd;
#define ICON_BED B00010000
#define ICON_FAN B00100000
#define ICON_HOT B01000000 //when any T > 50deg
#define PIC_MASK 0x7f
#define PIC_MASK 0x7F

//LEDs not used, for compatibility with Smoothieware
#define LED_HOTEND_ON B00000001
#define LED_BED_ON B00000010
#define LED_FAN_ON B00000100
#define LED_HOT B00001000
#define LED_MASK 0x0f
#define LED_MASK 0x0F

#define FBSIZE (LCD_WIDTH * LCD_HEIGHT + 2)

Expand Down
Loading

0 comments on commit 5070fae

Please sign in to comment.