diff --git a/Marlin/Version.h b/Marlin/Version.h index ca2fb62834c6..97775ef28056 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2021-12-28" +//#define STRING_DISTRIBUTION_DATE "2021-12-31" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/HAL/AVR/MarlinSerial.h b/Marlin/src/HAL/AVR/MarlinSerial.h index 0565c7b9db9e..84c5ddd2978e 100644 --- a/Marlin/src/HAL/AVR/MarlinSerial.h +++ b/Marlin/src/HAL/AVR/MarlinSerial.h @@ -217,7 +217,7 @@ #endif enum { HasEmergencyParser = Cfg::EMERGENCYPARSER }; - static inline bool emergency_parser_enabled() { return Cfg::EMERGENCYPARSER; } + static bool emergency_parser_enabled() { return Cfg::EMERGENCYPARSER; } FORCE_INLINE static uint8_t dropped() { return Cfg::DROPPED_RX ? rx_dropped_bytes : 0; } FORCE_INLINE static uint8_t buffer_overruns() { return Cfg::RX_OVERRUNS ? rx_buffer_overruns : 0; } diff --git a/Marlin/src/HAL/DUE/MarlinSerial.h b/Marlin/src/HAL/DUE/MarlinSerial.h index 4a62e2834f7f..5a61bffee0da 100644 --- a/Marlin/src/HAL/DUE/MarlinSerial.h +++ b/Marlin/src/HAL/DUE/MarlinSerial.h @@ -118,7 +118,7 @@ class MarlinSerial { static size_t write(const uint8_t c); static void flushTX(); - static inline bool emergency_parser_enabled() { return Cfg::EMERGENCYPARSER; } + static bool emergency_parser_enabled() { return Cfg::EMERGENCYPARSER; } FORCE_INLINE static uint8_t dropped() { return Cfg::DROPPED_RX ? rx_dropped_bytes : 0; } FORCE_INLINE static uint8_t buffer_overruns() { return Cfg::RX_OVERRUNS ? rx_buffer_overruns : 0; } diff --git a/Marlin/src/HAL/DUE/MarlinSerialUSB.cpp b/Marlin/src/HAL/DUE/MarlinSerialUSB.cpp index 67c597da80c4..8de2dc7924a0 100644 --- a/Marlin/src/HAL/DUE/MarlinSerialUSB.cpp +++ b/Marlin/src/HAL/DUE/MarlinSerialUSB.cpp @@ -41,7 +41,7 @@ extern "C" { int udi_cdc_getc(); bool udi_cdc_is_tx_ready(); int udi_cdc_putc(int value); -}; +} // Pending character static int pending_char = -1; diff --git a/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp b/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp index 3dcbbaecd28f..34cc256b30ff 100644 --- a/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp +++ b/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp @@ -10,7 +10,7 @@ #include "../../../sd/cardreader.h" extern "C" { -#include "sd_mmc_spi_mem.h" + #include "sd_mmc_spi_mem.h" } #define SD_MMC_BLOCK_SIZE 512 diff --git a/Marlin/src/HAL/LPC1768/include/SPI.h b/Marlin/src/HAL/LPC1768/include/SPI.h index ecd91f6a3b73..24f4759315bd 100644 --- a/Marlin/src/HAL/LPC1768/include/SPI.h +++ b/Marlin/src/HAL/LPC1768/include/SPI.h @@ -77,7 +77,7 @@ class SPISettings { //uint32_t spiRate() const { return spi_speed; } - static inline uint32_t spiRate2Clock(uint32_t spiRate) { + static uint32_t spiRate2Clock(uint32_t spiRate) { uint32_t Marlin_speed[7]; // CPSR is always 2 Marlin_speed[0] = 8333333; //(SCR: 2) desired: 8,000,000 actual: 8,333,333 +4.2% SPI_FULL_SPEED Marlin_speed[1] = 4166667; //(SCR: 5) desired: 4,000,000 actual: 4,166,667 +4.2% SPI_HALF_SPEED diff --git a/Marlin/src/HAL/LPC1768/tft/xpt2046.h b/Marlin/src/HAL/LPC1768/tft/xpt2046.h index aba0799e445f..7c456cf00e1b 100644 --- a/Marlin/src/HAL/LPC1768/tft/xpt2046.h +++ b/Marlin/src/HAL/LPC1768/tft/xpt2046.h @@ -65,8 +65,8 @@ class XPT2046 { static uint16_t getRawData(const XPTCoordinate coordinate); static bool isTouched(); - static inline void DataTransferBegin() { WRITE(TOUCH_CS_PIN, LOW); }; - static inline void DataTransferEnd() { WRITE(TOUCH_CS_PIN, HIGH); }; + static void DataTransferBegin() { WRITE(TOUCH_CS_PIN, LOW); }; + static void DataTransferEnd() { WRITE(TOUCH_CS_PIN, HIGH); }; #if ENABLED(TOUCH_BUTTONS_HW_SPI) static uint16_t HardwareIO(uint16_t data); #endif diff --git a/Marlin/src/HAL/NATIVE_SIM/tft/xpt2046.h b/Marlin/src/HAL/NATIVE_SIM/tft/xpt2046.h index 9ef1816c7b16..b131853643a8 100644 --- a/Marlin/src/HAL/NATIVE_SIM/tft/xpt2046.h +++ b/Marlin/src/HAL/NATIVE_SIM/tft/xpt2046.h @@ -62,8 +62,8 @@ class XPT2046 { static uint16_t getRawData(const XPTCoordinate coordinate); static bool isTouched(); - static inline void DataTransferBegin(); - static inline void DataTransferEnd(); + static void DataTransferBegin(); + static void DataTransferEnd(); #if ENABLED(TOUCH_BUTTONS_HW_SPI) static uint16_t HardwareIO(uint16_t data); #endif diff --git a/Marlin/src/HAL/STM32/tft/xpt2046.h b/Marlin/src/HAL/STM32/tft/xpt2046.h index 2cff3e29d05b..71de6b00251b 100644 --- a/Marlin/src/HAL/STM32/tft/xpt2046.h +++ b/Marlin/src/HAL/STM32/tft/xpt2046.h @@ -69,8 +69,8 @@ class XPT2046 { static uint16_t getRawData(const XPTCoordinate coordinate); static bool isTouched(); - static inline void DataTransferBegin() { if (SPIx.Instance) { HAL_SPI_Init(&SPIx); } WRITE(TOUCH_CS_PIN, LOW); }; - static inline void DataTransferEnd() { WRITE(TOUCH_CS_PIN, HIGH); }; + static void DataTransferBegin() { if (SPIx.Instance) { HAL_SPI_Init(&SPIx); } WRITE(TOUCH_CS_PIN, LOW); }; + static void DataTransferEnd() { WRITE(TOUCH_CS_PIN, HIGH); }; static uint16_t HardwareIO(uint16_t data); static uint16_t SoftwareIO(uint16_t data); static uint16_t IO(uint16_t data = 0) { return SPIx.Instance ? HardwareIO(data) : SoftwareIO(data); } diff --git a/Marlin/src/HAL/STM32F1/SPI.h b/Marlin/src/HAL/STM32F1/SPI.h index 2467432e0718..92f42263014a 100644 --- a/Marlin/src/HAL/STM32F1/SPI.h +++ b/Marlin/src/HAL/STM32F1/SPI.h @@ -417,7 +417,7 @@ class SPIClass { /** * @brief Wait until TXE (tx empty) flag is set and BSY (busy) flag unset. */ -static inline void waitSpiTxEnd(spi_dev *spi_d) { +static void waitSpiTxEnd(spi_dev *spi_d) { while (spi_is_tx_empty(spi_d) == 0) { /* nada */ } // wait until TXE=1 while (spi_is_busy(spi_d) != 0) { /* nada */ } // wait until BSY=0 } diff --git a/Marlin/src/HAL/STM32F1/pinsDebug.h b/Marlin/src/HAL/STM32F1/pinsDebug.h index 27f4b6732bfb..7828479658a9 100644 --- a/Marlin/src/HAL/STM32F1/pinsDebug.h +++ b/Marlin/src/HAL/STM32F1/pinsDebug.h @@ -54,11 +54,11 @@ extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS]; #define M43_NEVER_TOUCH(Q) (Q >= 9 && Q <= 12) // SERIAL/USB pins PA9(TX) PA10(RX) #endif -static inline int8_t get_pin_mode(pin_t pin) { +static int8_t get_pin_mode(pin_t pin) { return VALID_PIN(pin) ? _GET_MODE(pin) : -1; } -static inline pin_t DIGITAL_PIN_TO_ANALOG_PIN(pin_t pin) { +static pin_t DIGITAL_PIN_TO_ANALOG_PIN(pin_t pin) { if (!VALID_PIN(pin)) return -1; int8_t adc_channel = int8_t(PIN_MAP[pin].adc_channel); #ifdef NUM_ANALOG_INPUTS @@ -67,7 +67,7 @@ static inline pin_t DIGITAL_PIN_TO_ANALOG_PIN(pin_t pin) { return pin_t(adc_channel); } -static inline bool IS_ANALOG(pin_t pin) { +static bool IS_ANALOG(pin_t pin) { if (!VALID_PIN(pin)) return false; if (PIN_MAP[pin].adc_channel != ADCx) { #ifdef NUM_ANALOG_INPUTS @@ -78,11 +78,11 @@ static inline bool IS_ANALOG(pin_t pin) { return false; } -static inline bool GET_PINMODE(const pin_t pin) { +static bool GET_PINMODE(const pin_t pin) { return VALID_PIN(pin) && !IS_INPUT(pin); } -static inline bool GET_ARRAY_IS_DIGITAL(const int16_t array_pin) { +static bool GET_ARRAY_IS_DIGITAL(const int16_t array_pin) { const pin_t pin = GET_ARRAY_PIN(array_pin); return (!IS_ANALOG(pin) #ifdef NUM_ANALOG_INPUTS @@ -93,7 +93,7 @@ static inline bool GET_ARRAY_IS_DIGITAL(const int16_t array_pin) { #include "../../inc/MarlinConfig.h" // Allow pins/pins.h to set density -static inline void pwm_details(const pin_t pin) { +static void pwm_details(const pin_t pin) { if (PWM_PIN(pin)) { timer_dev * const tdev = PIN_MAP[pin].timer_device; const uint8_t channel = PIN_MAP[pin].timer_channel; @@ -113,7 +113,7 @@ static inline void pwm_details(const pin_t pin) { } } -static inline void print_port(pin_t pin) { +static void print_port(pin_t pin) { const char port = 'A' + char(pin >> 4); // pin div 16 const int16_t gbit = PIN_MAP[pin].gpio_bit; char buffer[8]; diff --git a/Marlin/src/HAL/STM32F1/tft/xpt2046.h b/Marlin/src/HAL/STM32F1/tft/xpt2046.h index aba0799e445f..7c456cf00e1b 100644 --- a/Marlin/src/HAL/STM32F1/tft/xpt2046.h +++ b/Marlin/src/HAL/STM32F1/tft/xpt2046.h @@ -65,8 +65,8 @@ class XPT2046 { static uint16_t getRawData(const XPTCoordinate coordinate); static bool isTouched(); - static inline void DataTransferBegin() { WRITE(TOUCH_CS_PIN, LOW); }; - static inline void DataTransferEnd() { WRITE(TOUCH_CS_PIN, HIGH); }; + static void DataTransferBegin() { WRITE(TOUCH_CS_PIN, LOW); }; + static void DataTransferEnd() { WRITE(TOUCH_CS_PIN, HIGH); }; #if ENABLED(TOUCH_BUTTONS_HW_SPI) static uint16_t HardwareIO(uint16_t data); #endif diff --git a/Marlin/src/HAL/shared/eeprom_api.h b/Marlin/src/HAL/shared/eeprom_api.h index 1f38639930dc..cd744f82dc79 100644 --- a/Marlin/src/HAL/shared/eeprom_api.h +++ b/Marlin/src/HAL/shared/eeprom_api.h @@ -49,7 +49,7 @@ class PersistentStore { // Write one or more bytes of data // Return 'true' on write error - static inline bool write_data(const int pos, const uint8_t *value, const size_t size=sizeof(uint8_t)) { + static bool write_data(const int pos, const uint8_t *value, const size_t size=sizeof(uint8_t)) { int data_pos = pos; uint16_t crc = 0; return write_data(data_pos, value, size, &crc); @@ -57,11 +57,11 @@ class PersistentStore { // Write a single byte of data // Return 'true' on write error - static inline bool write_data(const int pos, const uint8_t value) { return write_data(pos, &value); } + static bool write_data(const int pos, const uint8_t value) { return write_data(pos, &value); } // Read one or more bytes of data // Return 'true' on read error - static inline bool read_data(const int pos, uint8_t *value, const size_t size=1) { + static bool read_data(const int pos, uint8_t *value, const size_t size=1) { int data_pos = pos; uint16_t crc = 0; return read_data(data_pos, value, size, &crc); diff --git a/Marlin/src/core/macros.h b/Marlin/src/core/macros.h index 62675d131972..34fc3bc4108e 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -131,13 +131,13 @@ #ifdef __cplusplus // C++11 solution that is standards compliant. - template static inline constexpr void NOLESS(V& v, const N n) { + template static constexpr void NOLESS(V& v, const N n) { if (n > v) v = n; } - template static inline constexpr void NOMORE(V& v, const N n) { + template static constexpr void NOMORE(V& v, const N n) { if (n < v) v = n; } - template static inline constexpr void LIMIT(V& v, const N1 n1, const N2 n2) { + template static constexpr void LIMIT(V& v, const N1 n1, const N2 n2) { if (n1 > v) v = n1; else if (n2 < v) v = n2; } @@ -366,7 +366,7 @@ #undef ABS #ifdef __cplusplus - template static inline constexpr const T ABS(const T v) { return v >= 0 ? v : -v; } + template static constexpr const T ABS(const T v) { return v >= 0 ? v : -v; } #else #define ABS(a) ({__typeof__(a) _a = (a); _a >= 0 ? _a : -_a;}) #endif @@ -409,14 +409,14 @@ extern "C++" { // C++11 solution that is standards compliant. Return type is deduced automatically - template static inline constexpr auto _MIN(const L lhs, const R rhs) -> decltype(lhs + rhs) { + template static constexpr auto _MIN(const L lhs, const R rhs) -> decltype(lhs + rhs) { return lhs < rhs ? lhs : rhs; } - template static inline constexpr auto _MAX(const L lhs, const R rhs) -> decltype(lhs + rhs) { + template static constexpr auto _MAX(const L lhs, const R rhs) -> decltype(lhs + rhs) { return lhs > rhs ? lhs : rhs; } - template static inline constexpr const T _MIN(T V, Ts... Vs) { return _MIN(V, _MIN(Vs...)); } - template static inline constexpr const T _MAX(T V, Ts... Vs) { return _MAX(V, _MAX(Vs...)); } + template static constexpr const T _MIN(T V, Ts... Vs) { return _MIN(V, _MIN(Vs...)); } + template static constexpr const T _MAX(T V, Ts... Vs) { return _MAX(V, _MAX(Vs...)); } } diff --git a/Marlin/src/core/serial_hook.h b/Marlin/src/core/serial_hook.h index 2019b389e497..9b9fa8fa3828 100644 --- a/Marlin/src/core/serial_hook.h +++ b/Marlin/src/core/serial_hook.h @@ -37,7 +37,7 @@ class SerialMask { inline constexpr bool enabled(const SerialMask PortMask) const { return mask & PortMask.mask; } inline constexpr SerialMask combine(const SerialMask other) const { return SerialMask(mask | other.mask); } inline constexpr SerialMask operator<< (const int offset) const { return SerialMask(mask << offset); } - static inline SerialMask from(const serial_index_t index) { + static SerialMask from(const serial_index_t index) { if (index.valid()) return SerialMask(_BV(index.index)); return SerialMask(0); // A invalid index mean no output } diff --git a/Marlin/src/feature/babystep.h b/Marlin/src/feature/babystep.h index f8037678ca16..5693afb4fc5b 100644 --- a/Marlin/src/feature/babystep.h +++ b/Marlin/src/feature/babystep.h @@ -54,7 +54,7 @@ class Babystep { #if ENABLED(BABYSTEP_DISPLAY_TOTAL) static int16_t axis_total[BS_TOTAL_IND(Z_AXIS) + 1]; // Total babysteps since G28 - static inline void reset_total(const AxisEnum axis) { + static void reset_total(const AxisEnum axis) { if (TERN1(BABYSTEP_XY, axis == Z_AXIS)) axis_total[BS_TOTAL_IND(axis)] = 0; } @@ -63,7 +63,7 @@ class Babystep { static void add_steps(const AxisEnum axis, const int16_t distance); static void add_mm(const AxisEnum axis, const_float_t mm); - static inline bool has_steps() { + static bool has_steps() { return steps[BS_AXIS_IND(X_AXIS)] || steps[BS_AXIS_IND(Y_AXIS)] || steps[BS_AXIS_IND(Z_AXIS)]; } @@ -71,7 +71,7 @@ class Babystep { // Called by the Temperature or Stepper ISR to // apply accumulated babysteps to the axes. // - static inline void task() { + static void task() { LOOP_LE_N(i, BS_AXIS_IND(Z_AXIS)) step_axis(BS_AXIS(i)); } diff --git a/Marlin/src/feature/backlash.h b/Marlin/src/feature/backlash.h index 4d4e2940382c..17504cc78181 100644 --- a/Marlin/src/feature/backlash.h +++ b/Marlin/src/feature/backlash.h @@ -35,8 +35,8 @@ class Backlash { static float smoothing_mm; #endif - static inline void set_correction(const_float_t v) { correction = _MAX(0, _MIN(1.0, v)) * all_on; } - static inline float get_correction() { return float(ui8_to_percent(correction)) / 100.0f; } + static void set_correction(const_float_t v) { correction = _MAX(0, _MIN(1.0, v)) * all_on; } + static float get_correction() { return float(ui8_to_percent(correction)) / 100.0f; } #else static constexpr uint8_t correction = (BACKLASH_CORRECTION) * 0xFF; static const xyz_float_t distance_mm; @@ -53,7 +53,7 @@ class Backlash { static void measure_with_probe(); #endif - static inline float get_measurement(const AxisEnum a) { + static float get_measurement(const AxisEnum a) { UNUSED(a); // Return the measurement averaged over all readings return TERN(MEASURE_BACKLASH_WHEN_PROBING @@ -62,12 +62,12 @@ class Backlash { ); } - static inline bool has_measurement(const AxisEnum a) { + static bool has_measurement(const AxisEnum a) { UNUSED(a); return TERN0(MEASURE_BACKLASH_WHEN_PROBING, measured_count[a] > 0); } - static inline bool has_any_measurement() { + static bool has_any_measurement() { return has_measurement(X_AXIS) || has_measurement(Y_AXIS) || has_measurement(Z_AXIS); } diff --git a/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h b/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h index cc5469577189..06fae16c21e9 100644 --- a/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h +++ b/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h @@ -58,7 +58,7 @@ class mesh_bed_leveling { static void set_z(const int8_t px, const int8_t py, const_float_t z) { z_values[px][py] = z; } - static inline void zigzag(const int8_t index, int8_t &px, int8_t &py) { + static void zigzag(const int8_t index, int8_t &px, int8_t &py) { px = index % (GRID_MAX_POINTS_X); py = index / (GRID_MAX_POINTS_X); if (py & 1) px = (GRID_MAX_POINTS_X) - 1 - px; // Zig zag @@ -78,10 +78,10 @@ class mesh_bed_leveling { int8_t cy = (y - (MESH_MIN_Y)) * RECIPROCAL(MESH_Y_DIST); return constrain(cy, 0, GRID_MAX_CELLS_Y - 1); } - static inline xy_int8_t cell_indexes(const_float_t x, const_float_t y) { + static xy_int8_t cell_indexes(const_float_t x, const_float_t y) { return { cell_index_x(x), cell_index_y(y) }; } - static inline xy_int8_t cell_indexes(const xy_pos_t &xy) { return cell_indexes(xy.x, xy.y); } + static xy_int8_t cell_indexes(const xy_pos_t &xy) { return cell_indexes(xy.x, xy.y); } static int8_t probe_index_x(const_float_t x) { int8_t px = (x - (MESH_MIN_X) + 0.5f * (MESH_X_DIST)) * RECIPROCAL(MESH_X_DIST); @@ -91,10 +91,10 @@ class mesh_bed_leveling { int8_t py = (y - (MESH_MIN_Y) + 0.5f * (MESH_Y_DIST)) * RECIPROCAL(MESH_Y_DIST); return WITHIN(py, 0, (GRID_MAX_POINTS_Y) - 1) ? py : -1; } - static inline xy_int8_t probe_indexes(const_float_t x, const_float_t y) { + static xy_int8_t probe_indexes(const_float_t x, const_float_t y) { return { probe_index_x(x), probe_index_y(y) }; } - static inline xy_int8_t probe_indexes(const xy_pos_t &xy) { return probe_indexes(xy.x, xy.y); } + static xy_int8_t probe_indexes(const xy_pos_t &xy) { return probe_indexes(xy.x, xy.y); } static float calc_z0(const_float_t a0, const_float_t a1, const_float_t z1, const_float_t a2, const_float_t z2) { const float delta_z = (z2 - z1) / (a2 - a1), diff --git a/Marlin/src/feature/bedlevel/ubl/ubl.h b/Marlin/src/feature/bedlevel/ubl/ubl.h index ffabadd990b3..73581504b787 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl.h +++ b/Marlin/src/feature/bedlevel/ubl/ubl.h @@ -80,7 +80,7 @@ class unified_bed_leveling { static void tilt_mesh_based_on_3pts(const_float_t z1, const_float_t z2, const_float_t z3); static void tilt_mesh_based_on_probed_grid(const bool do_ubl_mesh_map); static bool smart_fill_one(const uint8_t x, const uint8_t y, const int8_t xdir, const int8_t ydir); - static inline bool smart_fill_one(const xy_uint8_t &pos, const xy_uint8_t &dir) { + static bool smart_fill_one(const xy_uint8_t &pos, const xy_uint8_t &dir) { return smart_fill_one(pos.x, pos.y, dir.x, dir.y); } static void smart_fill_mesh(); @@ -124,7 +124,7 @@ class unified_bed_leveling { static bool lcd_map_control; static void steppers_were_disabled(); #else - static inline void steppers_were_disabled() {} + static void steppers_were_disabled() {} #endif static volatile int16_t encoder_diff; // Volatile because buttons may change it at interrupt time @@ -157,10 +157,10 @@ class unified_bed_leveling { return constrain(cell_index_y_raw(y), 0, GRID_MAX_CELLS_Y - 1); } - static inline xy_int8_t cell_indexes(const_float_t x, const_float_t y) { + static xy_int8_t cell_indexes(const_float_t x, const_float_t y) { return { cell_index_x(x), cell_index_y(y) }; } - static inline xy_int8_t cell_indexes(const xy_pos_t &xy) { return cell_indexes(xy.x, xy.y); } + static xy_int8_t cell_indexes(const xy_pos_t &xy) { return cell_indexes(xy.x, xy.y); } static int8_t closest_x_index(const_float_t x) { const int8_t px = (x - (MESH_MIN_X) + (MESH_X_DIST) * 0.5) * RECIPROCAL(MESH_X_DIST); @@ -170,7 +170,7 @@ class unified_bed_leveling { const int8_t py = (y - (MESH_MIN_Y) + (MESH_Y_DIST) * 0.5) * RECIPROCAL(MESH_Y_DIST); return WITHIN(py, 0, (GRID_MAX_POINTS_Y) - 1) ? py : -1; } - static inline xy_int8_t closest_indexes(const xy_pos_t &xy) { + static xy_int8_t closest_indexes(const xy_pos_t &xy) { return { closest_x_index(xy.x), closest_y_index(xy.y) }; } @@ -203,7 +203,7 @@ class unified_bed_leveling { * z_correction_for_x_on_horizontal_mesh_line is an optimization for * the case where the printer is making a vertical line that only crosses horizontal mesh lines. */ - static inline float z_correction_for_x_on_horizontal_mesh_line(const_float_t rx0, const int x1_i, const int yi) { + static float z_correction_for_x_on_horizontal_mesh_line(const_float_t rx0, const int x1_i, const int yi) { if (!WITHIN(x1_i, 0, (GRID_MAX_POINTS_X) - 1) || !WITHIN(yi, 0, (GRID_MAX_POINTS_Y) - 1)) { if (DEBUGGING(LEVELING)) { @@ -226,7 +226,7 @@ class unified_bed_leveling { // // See comments above for z_correction_for_x_on_horizontal_mesh_line // - static inline float z_correction_for_y_on_vertical_mesh_line(const_float_t ry0, const int xi, const int y1_i) { + static float z_correction_for_y_on_vertical_mesh_line(const_float_t ry0, const int xi, const int y1_i) { if (!WITHIN(xi, 0, (GRID_MAX_POINTS_X) - 1) || !WITHIN(y1_i, 0, (GRID_MAX_POINTS_Y) - 1)) { if (DEBUGGING(LEVELING)) { @@ -285,12 +285,12 @@ class unified_bed_leveling { return z0; } - static inline float get_z_correction(const xy_pos_t &pos) { return get_z_correction(pos.x, pos.y); } + static float get_z_correction(const xy_pos_t &pos) { return get_z_correction(pos.x, pos.y); } - static inline float mesh_index_to_xpos(const uint8_t i) { + static float mesh_index_to_xpos(const uint8_t i) { return i < (GRID_MAX_POINTS_X) ? pgm_read_float(&_mesh_index_to_xpos[i]) : MESH_MIN_X + i * (MESH_X_DIST); } - static inline float mesh_index_to_ypos(const uint8_t i) { + static float mesh_index_to_ypos(const uint8_t i) { return i < (GRID_MAX_POINTS_Y) ? pgm_read_float(&_mesh_index_to_ypos[i]) : MESH_MIN_Y + i * (MESH_Y_DIST); } @@ -300,7 +300,7 @@ class unified_bed_leveling { static void line_to_destination_cartesian(const_feedRate_t scaled_fr_mm_s, const uint8_t e); #endif - static inline bool mesh_is_valid() { + static bool mesh_is_valid() { GRID_LOOP(x, y) if (isnan(z_values[x][y])) return false; return true; } diff --git a/Marlin/src/feature/bltouch.h b/Marlin/src/feature/bltouch.h index ae3ab6630036..fa857bb96ab6 100644 --- a/Marlin/src/feature/bltouch.h +++ b/Marlin/src/feature/bltouch.h @@ -76,7 +76,7 @@ class BLTouch { static constexpr bool high_speed_mode = false; #endif - static inline float z_extra_clearance() { return high_speed_mode ? 7 : 0; } + static float z_extra_clearance() { return high_speed_mode ? 7 : 0; } // DEPLOY and STOW are wrapped for error handling - these are used by homing and by probing static bool deploy() { return deploy_proc(); } diff --git a/Marlin/src/feature/cancel_object.h b/Marlin/src/feature/cancel_object.h index 1d2d77f20334..62548a371937 100644 --- a/Marlin/src/feature/cancel_object.h +++ b/Marlin/src/feature/cancel_object.h @@ -32,10 +32,10 @@ class CancelObject { static void cancel_object(const int8_t obj); static void uncancel_object(const int8_t obj); static void report(); - static inline bool is_canceled(const int8_t obj) { return TEST(canceled, obj); } - static inline void clear_active_object() { set_active_object(-1); } - static inline void cancel_active_object() { cancel_object(active_object); } - static inline void reset() { canceled = 0x0000; object_count = 0; clear_active_object(); } + static bool is_canceled(const int8_t obj) { return TEST(canceled, obj); } + static void clear_active_object() { set_active_object(-1); } + static void cancel_active_object() { cancel_object(active_object); } + static void reset() { canceled = 0x0000; object_count = 0; clear_active_object(); } }; extern CancelObject cancelable; diff --git a/Marlin/src/feature/caselight.h b/Marlin/src/feature/caselight.h index b2e82f9b838f..2e85b59ef938 100644 --- a/Marlin/src/feature/caselight.h +++ b/Marlin/src/feature/caselight.h @@ -49,8 +49,8 @@ class CaseLight { } static void update(const bool sflag); - static inline void update_brightness() { update(false); } - static inline void update_enabled() { update(true); } + static void update_brightness() { update(false); } + static void update_enabled() { update(true); } #if ENABLED(CASE_LIGHT_IS_COLOR_LED) private: diff --git a/Marlin/src/feature/controllerfan.h b/Marlin/src/feature/controllerfan.h index 55f2d5cfc7aa..55eb2359b067 100644 --- a/Marlin/src/feature/controllerfan.h +++ b/Marlin/src/feature/controllerfan.h @@ -60,9 +60,9 @@ class ControllerFan { #else static const controllerFan_settings_t &settings; #endif - static inline bool state() { return speed > 0; } - static inline void init() { reset(); } - static inline void reset() { TERN_(CONTROLLER_FAN_EDITABLE, settings = controllerFan_defaults); } + static bool state() { return speed > 0; } + static void init() { reset(); } + static void reset() { TERN_(CONTROLLER_FAN_EDITABLE, settings = controllerFan_defaults); } static void setup(); static void update(); }; diff --git a/Marlin/src/feature/encoder_i2c.cpp b/Marlin/src/feature/encoder_i2c.cpp index 87e611f86c23..2ccd686a992d 100644 --- a/Marlin/src/feature/encoder_i2c.cpp +++ b/Marlin/src/feature/encoder_i2c.cpp @@ -756,7 +756,7 @@ int8_t I2CPositionEncodersMgr::parse() { if (!parser.has_value()) { SERIAL_ECHOLNPGM("?A seen, but no address specified! [30-200]"); return I2CPE_PARSE_ERR; - }; + } I2CPE_addr = parser.value_byte(); if (!WITHIN(I2CPE_addr, 30, 200)) { // reserve the first 30 and last 55 @@ -775,7 +775,7 @@ int8_t I2CPositionEncodersMgr::parse() { if (!parser.has_value()) { SERIAL_ECHOLNPGM("?I seen, but no index specified! [0-", I2CPE_ENCODER_CNT - 1, "]"); return I2CPE_PARSE_ERR; - }; + } I2CPE_idx = parser.value_byte(); if (I2CPE_idx >= I2CPE_ENCODER_CNT) { @@ -791,7 +791,7 @@ int8_t I2CPositionEncodersMgr::parse() { I2CPE_anyaxis = parser.seen_axis(); return I2CPE_PARSE_OK; -}; +} /** * M860: Report the position(s) of position encoder module(s). @@ -934,7 +934,7 @@ void I2CPositionEncodersMgr::M864() { if (!parser.has_value()) { SERIAL_ECHOLNPGM("?S seen, but no address specified! [30-200]"); return; - }; + } newAddress = parser.value_byte(); if (!WITHIN(newAddress, 30, 200)) { diff --git a/Marlin/src/feature/fancheck.h b/Marlin/src/feature/fancheck.h index 6e8038b498e7..c8665a0e96e8 100644 --- a/Marlin/src/feature/fancheck.h +++ b/Marlin/src/feature/fancheck.h @@ -56,7 +56,7 @@ class FanCheck { static uint8_t rps[TACHO_COUNT]; static TachoError error; - static inline void report_speed_error(uint8_t fan); + static void report_speed_error(uint8_t fan); public: @@ -67,11 +67,11 @@ class FanCheck { static void compute_speed(uint16_t elapsedTime); static void print_fan_states(); #if HAS_PWMFANCHECK - static inline void toggle_measuring() { measuring = !measuring; } - static inline bool is_measuring() { return measuring; } + static void toggle_measuring() { measuring = !measuring; } + static bool is_measuring() { return measuring; } #endif - static inline void check_deferred_error() { + static void check_deferred_error() { if (error == TachoError::DETECTED) { error = TachoError::REPORTED; TERN(PARK_HEAD_ON_PAUSE, queue.inject(F("M125")), kill(GET_TEXT_F(MSG_FAN_SPEED_FAULT))); diff --git a/Marlin/src/feature/filwidth.h b/Marlin/src/feature/filwidth.h index e63d3d719ffb..e234380e981a 100644 --- a/Marlin/src/feature/filwidth.h +++ b/Marlin/src/feature/filwidth.h @@ -41,9 +41,9 @@ class FilamentWidthSensor { FilamentWidthSensor() { init(); } static void init(); - static inline void enable(const bool ena) { enabled = ena; } + static void enable(const bool ena) { enabled = ena; } - static inline void set_delay_cm(const uint8_t cm) { + static void set_delay_cm(const uint8_t cm) { meas_delay_cm = _MIN(cm, MAX_MEASUREMENT_DELAY); } @@ -67,18 +67,18 @@ class FilamentWidthSensor { } // Convert raw measurement to mm - static inline float raw_to_mm(const uint16_t v) { return v * 5.0f * RECIPROCAL(float(MAX_RAW_THERMISTOR_VALUE)); } - static inline float raw_to_mm() { return raw_to_mm(raw); } + static float raw_to_mm(const uint16_t v) { return v * 5.0f * RECIPROCAL(float(MAX_RAW_THERMISTOR_VALUE)); } + static float raw_to_mm() { return raw_to_mm(raw); } // A scaled reading is ready // Divide to get to 0-16384 range since we used 1/128 IIR filter approach - static inline void reading_ready() { raw = accum >> 10; } + static void reading_ready() { raw = accum >> 10; } // Update mm from the raw measurement - static inline void update_measured_mm() { measured_mm = raw_to_mm(); } + static void update_measured_mm() { measured_mm = raw_to_mm(); } // Update ring buffer used to delay filament measurements - static inline void advance_e(const_float_t e_move) { + static void advance_e(const_float_t e_move) { // Increment counters with the E distance e_count += e_move; @@ -106,7 +106,7 @@ class FilamentWidthSensor { } // Dynamically set the volumetric multiplier based on the delayed width measurement. - static inline void update_volumetric() { + static void update_volumetric() { if (enabled) { int8_t read_index = index_r - meas_delay_cm; if (read_index < 0) read_index += MMD_CM; // Loop around buffer if needed diff --git a/Marlin/src/feature/host_actions.h b/Marlin/src/feature/host_actions.h index 45379afc29ec..78a7821eba85 100644 --- a/Marlin/src/feature/host_actions.h +++ b/Marlin/src/feature/host_actions.h @@ -97,7 +97,7 @@ class HostUI { static void handle_response(const uint8_t response); static void notify_P(PGM_P const message); - static inline void notify(FSTR_P const fmsg) { notify_P(FTOP(fmsg)); } + static void notify(FSTR_P const fmsg) { notify_P(FTOP(fmsg)); } static void notify(const char * const message); static void prompt_begin(const PromptReason reason, FSTR_P const fstr, const char extra_char='\0'); @@ -105,7 +105,7 @@ class HostUI { static void prompt_end(); static void prompt_do(const PromptReason reason, FSTR_P const pstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr); static void prompt_do(const PromptReason reason, FSTR_P const pstr, const char extra_char, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr); - static inline void prompt_open(const PromptReason reason, FSTR_P const pstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr) { + static void prompt_open(const PromptReason reason, FSTR_P const pstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr) { if (host_prompt_reason == PROMPT_NOT_DEFINED) prompt_do(reason, pstr, btn1, btn2); } diff --git a/Marlin/src/feature/leds/leds.h b/Marlin/src/feature/leds/leds.h index 74964b51a8e4..7110a9ba8255 100644 --- a/Marlin/src/feature/leds/leds.h +++ b/Marlin/src/feature/leds/leds.h @@ -118,7 +118,7 @@ class LEDLights { OPTARG(NEOPIXEL_IS_SEQUENTIAL, bool isSequence=false) ); - static inline void set_color(uint8_t r, uint8_t g, uint8_t b + static void set_color(uint8_t r, uint8_t g, uint8_t b OPTARG(HAS_WHITE_LED, uint8_t w=0) OPTARG(NEOPIXEL_LED, uint8_t i=NEOPIXEL_BRIGHTNESS) OPTARG(NEOPIXEL_IS_SEQUENTIAL, bool isSequence=false) @@ -126,23 +126,23 @@ class LEDLights { set_color(LEDColor(r, g, b OPTARG(HAS_WHITE_LED, w) OPTARG(NEOPIXEL_LED, i)) OPTARG(NEOPIXEL_IS_SEQUENTIAL, isSequence)); } - static inline void set_off() { set_color(LEDColorOff()); } - static inline void set_green() { set_color(LEDColorGreen()); } - static inline void set_white() { set_color(LEDColorWhite()); } + static void set_off() { set_color(LEDColorOff()); } + static void set_green() { set_color(LEDColorGreen()); } + static void set_white() { set_color(LEDColorWhite()); } #if ENABLED(LED_COLOR_PRESETS) static const LEDColor defaultLEDColor; - static inline void set_default() { set_color(defaultLEDColor); } - static inline void set_red() { set_color(LEDColorRed()); } - static inline void set_orange() { set_color(LEDColorOrange()); } - static inline void set_yellow() { set_color(LEDColorYellow()); } - static inline void set_blue() { set_color(LEDColorBlue()); } - static inline void set_indigo() { set_color(LEDColorIndigo()); } - static inline void set_violet() { set_color(LEDColorViolet()); } + static void set_default() { set_color(defaultLEDColor); } + static void set_red() { set_color(LEDColorRed()); } + static void set_orange() { set_color(LEDColorOrange()); } + static void set_yellow() { set_color(LEDColorYellow()); } + static void set_blue() { set_color(LEDColorBlue()); } + static void set_indigo() { set_color(LEDColorIndigo()); } + static void set_violet() { set_color(LEDColorViolet()); } #endif #if ENABLED(PRINTER_EVENT_LEDS) - static inline LEDColor get_color() { return lights_on ? color : LEDColorOff(); } + static LEDColor get_color() { return lights_on ? color : LEDColorOff(); } #endif #if ANY(LED_CONTROL_MENU, PRINTER_EVENT_LEDS, CASE_LIGHT_IS_COLOR_LED) @@ -154,14 +154,14 @@ class LEDLights { static void toggle(); // swap "off" with color #endif #if EITHER(LED_CONTROL_MENU, CASE_LIGHT_USE_RGB_LED) - static inline void update() { set_color(color); } + static void update() { set_color(color); } #endif #ifdef LED_BACKLIGHT_TIMEOUT private: static millis_t led_off_time; public: - static inline void reset_timeout(const millis_t &ms) { + static void reset_timeout(const millis_t &ms) { led_off_time = ms + LED_BACKLIGHT_TIMEOUT; if (!lights_on) update(); } @@ -181,7 +181,7 @@ extern LEDLights leds; static void set_color(const LEDColor &color); - static inline void set_color(uint8_t r, uint8_t g, uint8_t b + static void set_color(uint8_t r, uint8_t g, uint8_t b OPTARG(HAS_WHITE_LED, uint8_t w=0) OPTARG(NEOPIXEL_LED, uint8_t i=NEOPIXEL_BRIGHTNESS) ) { @@ -191,26 +191,26 @@ extern LEDLights leds; )); } - static inline void set_off() { set_color(LEDColorOff()); } - static inline void set_green() { set_color(LEDColorGreen()); } - static inline void set_white() { set_color(LEDColorWhite()); } + static void set_off() { set_color(LEDColorOff()); } + static void set_green() { set_color(LEDColorGreen()); } + static void set_white() { set_color(LEDColorWhite()); } #if ENABLED(NEO2_COLOR_PRESETS) static const LEDColor defaultLEDColor; - static inline void set_default() { set_color(defaultLEDColor); } - static inline void set_red() { set_color(LEDColorRed()); } - static inline void set_orange() { set_color(LEDColorOrange()); } - static inline void set_yellow() { set_color(LEDColorYellow()); } - static inline void set_blue() { set_color(LEDColorBlue()); } - static inline void set_indigo() { set_color(LEDColorIndigo()); } - static inline void set_violet() { set_color(LEDColorViolet()); } + static void set_default() { set_color(defaultLEDColor); } + static void set_red() { set_color(LEDColorRed()); } + static void set_orange() { set_color(LEDColorOrange()); } + static void set_yellow() { set_color(LEDColorYellow()); } + static void set_blue() { set_color(LEDColorBlue()); } + static void set_indigo() { set_color(LEDColorIndigo()); } + static void set_violet() { set_color(LEDColorViolet()); } #endif #if ENABLED(NEOPIXEL2_SEPARATE) static LEDColor color; // last non-off color static bool lights_on; // the last set color was "on" static void toggle(); // swap "off" with color - static inline void update() { set_color(color); } + static void update() { set_color(color); } #endif }; diff --git a/Marlin/src/feature/leds/neopixel.h b/Marlin/src/feature/leds/neopixel.h index 814ae9c8d839..ae75316b8ffc 100644 --- a/Marlin/src/feature/leds/neopixel.h +++ b/Marlin/src/feature/leds/neopixel.h @@ -94,12 +94,12 @@ class Marlin_NeoPixel { static void reset_background_color(); #endif - static inline void begin() { + static void begin() { adaneo1.begin(); TERN_(CONJOINED_NEOPIXEL, adaneo2.begin()); } - static inline void set_pixel_color(const uint16_t n, const uint32_t c) { + static void set_pixel_color(const uint16_t n, const uint32_t c) { #if ENABLED(NEOPIXEL2_INSERIES) if (n >= NEOPIXEL_PIXELS) adaneo2.setPixelColor(n - (NEOPIXEL_PIXELS), c); else adaneo1.setPixelColor(n, c); @@ -109,12 +109,12 @@ class Marlin_NeoPixel { #endif } - static inline void set_brightness(const uint8_t b) { + static void set_brightness(const uint8_t b) { adaneo1.setBrightness(b); TERN_(CONJOINED_NEOPIXEL, adaneo2.setBrightness(b)); } - static inline void show() { + static void show() { // Some platforms cannot maintain PWM output when NeoPixel disables interrupts for long durations. TERN_(HAS_PAUSE_SERVO_OUTPUT, PAUSE_SERVO_OUTPUT()); adaneo1.show(); @@ -130,11 +130,11 @@ class Marlin_NeoPixel { } // Accessors - static inline uint16_t pixels() { return adaneo1.numPixels() * TERN1(NEOPIXEL2_INSERIES, 2); } + static uint16_t pixels() { return adaneo1.numPixels() * TERN1(NEOPIXEL2_INSERIES, 2); } - static inline uint8_t brightness() { return adaneo1.getBrightness(); } + static uint8_t brightness() { return adaneo1.getBrightness(); } - static inline uint32_t Color(uint8_t r, uint8_t g, uint8_t b OPTARG(HAS_WHITE_LED, uint8_t w)) { + static uint32_t Color(uint8_t r, uint8_t g, uint8_t b OPTARG(HAS_WHITE_LED, uint8_t w)) { return adaneo1.Color(r, g, b OPTARG(HAS_WHITE_LED, w)); } }; @@ -165,18 +165,18 @@ extern Marlin_NeoPixel neo; static void set_color(const uint32_t c); - static inline void begin() { adaneo.begin(); } - static inline void set_pixel_color(const uint16_t n, const uint32_t c) { adaneo.setPixelColor(n, c); } - static inline void set_brightness(const uint8_t b) { adaneo.setBrightness(b); } - static inline void show() { + static void begin() { adaneo.begin(); } + static void set_pixel_color(const uint16_t n, const uint32_t c) { adaneo.setPixelColor(n, c); } + static void set_brightness(const uint8_t b) { adaneo.setBrightness(b); } + static void show() { adaneo.show(); adaneo.setPin(NEOPIXEL2_PIN); } // Accessors - static inline uint16_t pixels() { return adaneo.numPixels();} - static inline uint8_t brightness() { return adaneo.getBrightness(); } - static inline uint32_t Color(uint8_t r, uint8_t g, uint8_t b OPTARG(HAS_WHITE_LED2, uint8_t w)) { + static uint16_t pixels() { return adaneo.numPixels();} + static uint8_t brightness() { return adaneo.getBrightness(); } + static uint32_t Color(uint8_t r, uint8_t g, uint8_t b OPTARG(HAS_WHITE_LED2, uint8_t w)) { return adaneo.Color(r, g, b OPTARG(HAS_WHITE_LED2, w)); } }; diff --git a/Marlin/src/feature/leds/printer_event_leds.h b/Marlin/src/feature/leds/printer_event_leds.h index b2201433d821..2a4342e8f55c 100644 --- a/Marlin/src/feature/leds/printer_event_leds.h +++ b/Marlin/src/feature/leds/printer_event_leds.h @@ -36,32 +36,32 @@ class PrinterEventLEDs { static bool leds_off_after_print; #endif - static inline void set_done() { TERN(LED_COLOR_PRESETS, leds.set_default(), leds.set_off()); } + static void set_done() { TERN(LED_COLOR_PRESETS, leds.set_default(), leds.set_off()); } public: #if HAS_TEMP_HOTEND - static inline LEDColor onHotendHeatingStart() { old_intensity = 0; return leds.get_color(); } + static LEDColor onHotendHeatingStart() { old_intensity = 0; return leds.get_color(); } static void onHotendHeating(const celsius_t start, const celsius_t current, const celsius_t target); #endif #if HAS_HEATED_BED - static inline LEDColor onBedHeatingStart() { old_intensity = 127; return leds.get_color(); } + static LEDColor onBedHeatingStart() { old_intensity = 127; return leds.get_color(); } static void onBedHeating(const celsius_t start, const celsius_t current, const celsius_t target); #endif #if HAS_HEATED_CHAMBER - static inline LEDColor onChamberHeatingStart() { old_intensity = 127; return leds.get_color(); } + static LEDColor onChamberHeatingStart() { old_intensity = 127; return leds.get_color(); } static void onChamberHeating(const celsius_t start, const celsius_t current, const celsius_t target); #endif #if HAS_TEMP_HOTEND || HAS_HEATED_BED || HAS_HEATED_CHAMBER - static inline void onHeatingDone() { leds.set_white(); } - static inline void onPidTuningDone(LEDColor c) { leds.set_color(c); } + static void onHeatingDone() { leds.set_white(); } + static void onPidTuningDone(LEDColor c) { leds.set_color(c); } #endif #if ENABLED(SDSUPPORT) - static inline void onPrintCompleted() { + static void onPrintCompleted() { leds.set_green(); #if HAS_LEDS_OFF_FLAG leds_off_after_print = true; @@ -71,7 +71,7 @@ class PrinterEventLEDs { #endif } - static inline void onResumeAfterWait() { + static void onResumeAfterWait() { #if HAS_LEDS_OFF_FLAG if (leds_off_after_print) { set_done(); diff --git a/Marlin/src/feature/max7219.h b/Marlin/src/feature/max7219.h index c25fef173060..809bda6d4b35 100644 --- a/Marlin/src/feature/max7219.h +++ b/Marlin/src/feature/max7219.h @@ -88,13 +88,13 @@ class Max7219 { static void send(const uint8_t reg, const uint8_t data); // Refresh all units - static inline void refresh() { for (uint8_t i = 0; i < 8; i++) refresh_line(i); } + static void refresh() { for (uint8_t i = 0; i < 8; i++) refresh_line(i); } // Suspend / resume updates to the LED unit // Use these methods to speed up multiple changes // or to apply updates from interrupt context. - static inline void suspend() { suspended++; } - static inline void resume() { suspended--; suspended |= 0x80; } + static void suspend() { suspended++; } + static void resume() { suspended--; suspended |= 0x80; } // Update a single native line on all units static void refresh_line(const uint8_t line); diff --git a/Marlin/src/feature/mixing.h b/Marlin/src/feature/mixing.h index f700c7b65b7d..85d52d69c8f3 100644 --- a/Marlin/src/feature/mixing.h +++ b/Marlin/src/feature/mixing.h @@ -126,7 +126,7 @@ class Mixer { static mixer_perc_t mix[MIXING_STEPPERS]; // Scratch array for the Mix in proportion to 100 - static inline void copy_mix_to_color(mixer_comp_t (&tcolor)[MIXING_STEPPERS]) { + static void copy_mix_to_color(mixer_comp_t (&tcolor)[MIXING_STEPPERS]) { // Scale each component to the largest one in terms of COLOR_A_MASK // So the largest component will be COLOR_A_MASK and the other will be in proportion to it const float scale = (COLOR_A_MASK) * RECIPROCAL(_MAX( @@ -145,7 +145,7 @@ class Mixer { #endif } - static inline void update_mix_from_vtool(const uint8_t j=selected_vtool) { + static void update_mix_from_vtool(const uint8_t j=selected_vtool) { float ctot = 0; MIXER_STEPPER_LOOP(i) ctot += color[j][i]; //MIXER_STEPPER_LOOP(i) mix[i] = 100.0f * color[j][i] / ctot; @@ -165,7 +165,7 @@ class Mixer { #if HAS_DUAL_MIXING // Update the virtual tool from an edited mix - static inline void update_vtool_from_mix() { + static void update_vtool_from_mix() { copy_mix_to_color(color[selected_vtool]); TERN_(GRADIENT_MIX, refresh_gradient()); // MIXER_STEPPER_LOOP(i) collector[i] = mix[i]; @@ -182,7 +182,7 @@ class Mixer { // Update the current mix from the gradient for a given Z static void update_gradient_for_z(const_float_t z); static void update_gradient_for_planner_z(); - static inline void gradient_control(const_float_t z) { + static void gradient_control(const_float_t z) { if (gradient.enabled) { if (z >= gradient.end_z) T(gradient.end_vtool); @@ -191,7 +191,7 @@ class Mixer { } } - static inline void update_mix_from_gradient() { + static void update_mix_from_gradient() { float ctot = 0; MIXER_STEPPER_LOOP(i) ctot += gradient.color[i]; MIXER_STEPPER_LOOP(i) mix[i] = (mixer_perc_t)CEIL(100.0f * gradient.color[i] / ctot); diff --git a/Marlin/src/feature/mmu/mmu2.h b/Marlin/src/feature/mmu/mmu2.h index 9574e2217f82..7d3d9ec4df38 100644 --- a/Marlin/src/feature/mmu/mmu2.h +++ b/Marlin/src/feature/mmu/mmu2.h @@ -43,7 +43,7 @@ class MMU2 { static void init(); static void reset(); - static inline bool enabled() { return _enabled; } + static bool enabled() { return _enabled; } static void mmu_loop(); static void tool_change(const uint8_t index); static void tool_change(const char *special); @@ -57,10 +57,10 @@ class MMU2 { static bool eject_filament(const uint8_t index, const bool recover); private: - static inline bool rx_str(FSTR_P fstr); - static inline void tx_str(FSTR_P fstr); - static inline void tx_printf(FSTR_P ffmt, const int argument); - static inline void tx_printf(FSTR_P ffmt, const int argument1, const int argument2); + static bool rx_str(FSTR_P fstr); + static void tx_str(FSTR_P fstr); + static void tx_printf(FSTR_P ffmt, const int argument); + static void tx_printf(FSTR_P ffmt, const int argument1, const int argument2); static void clear_rx_buffer(); static bool rx_ok(); @@ -99,7 +99,7 @@ class MMU2 { static millis_t prev_request, prev_P0_request; static char rx_buffer[MMU_RX_SIZE], tx_buffer[MMU_TX_SIZE]; - static inline void set_runout_valid(const bool valid) { + static void set_runout_valid(const bool valid) { finda_runout_valid = valid; #if HAS_FILAMENT_SENSOR if (valid) runout.reset(); diff --git a/Marlin/src/feature/power.h b/Marlin/src/feature/power.h index 7f5a97e6df83..42c2c8494288 100644 --- a/Marlin/src/feature/power.h +++ b/Marlin/src/feature/power.h @@ -40,7 +40,7 @@ class Power { #if ENABLED(AUTO_POWER_CONTROL) && POWER_OFF_DELAY > 0 static void power_off_soon(); #else - static inline void power_off_soon() { power_off(); } + static void power_off_soon() { power_off(); } #endif #if ENABLED(AUTO_POWER_CONTROL) diff --git a/Marlin/src/feature/powerloss.h b/Marlin/src/feature/powerloss.h index 76cb398af2a1..50abad92220f 100644 --- a/Marlin/src/feature/powerloss.h +++ b/Marlin/src/feature/powerloss.h @@ -152,7 +152,7 @@ class PrintJobRecovery { static void init(); static void prepare(); - static inline void setup() { + static void setup() { #if PIN_EXISTS(POWER_LOSS) #if ENABLED(POWER_LOSS_PULLUP) SET_INPUT_PULLUP(POWER_LOSS_PIN); @@ -165,28 +165,28 @@ class PrintJobRecovery { } // Track each command's file offsets - static inline uint32_t command_sdpos() { return sdpos[queue_index_r]; } - static inline void commit_sdpos(const uint8_t index_w) { sdpos[index_w] = cmd_sdpos; } + static uint32_t command_sdpos() { return sdpos[queue_index_r]; } + static void commit_sdpos(const uint8_t index_w) { sdpos[index_w] = cmd_sdpos; } static bool enabled; static void enable(const bool onoff); static void changed(); - static inline bool exists() { return card.jobRecoverFileExists(); } - static inline void open(const bool read) { card.openJobRecoveryFile(read); } - static inline void close() { file.close(); } + static bool exists() { return card.jobRecoverFileExists(); } + static void open(const bool read) { card.openJobRecoveryFile(read); } + static void close() { file.close(); } static void check(); static void resume(); static void purge(); - static inline void cancel() { purge(); IF_DISABLED(NO_SD_AUTOSTART, card.autofile_begin()); } + static void cancel() { purge(); IF_DISABLED(NO_SD_AUTOSTART, card.autofile_begin()); } static void load(); static void save(const bool force=ENABLED(SAVE_EACH_CMD_MODE), const float zraise=POWER_LOSS_ZRAISE, const bool raised=false); #if PIN_EXISTS(POWER_LOSS) - static inline void outage() { + static void outage() { static constexpr uint8_t OUTAGE_THRESHOLD = 3; static uint8_t outage_counter = 0; if (enabled && READ(POWER_LOSS_PIN) == POWER_LOSS_STATE) { @@ -199,14 +199,14 @@ class PrintJobRecovery { #endif // The referenced file exists - static inline bool interrupted_file_exists() { return card.fileExists(info.sd_filename); } + static bool interrupted_file_exists() { return card.fileExists(info.sd_filename); } - static inline bool valid() { return info.valid() && interrupted_file_exists(); } + static bool valid() { return info.valid() && interrupted_file_exists(); } #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) static void debug(FSTR_P const prefix); #else - static inline void debug(FSTR_P const) {} + static void debug(FSTR_P const) {} #endif private: diff --git a/Marlin/src/feature/probe_temp_comp.h b/Marlin/src/feature/probe_temp_comp.h index 4579f2187cd4..1db7d04e89dc 100644 --- a/Marlin/src/feature/probe_temp_comp.h +++ b/Marlin/src/feature/probe_temp_comp.h @@ -74,11 +74,11 @@ class ProbeTempComp { static int16_t z_offsets_hotend[PTC_HOTEND_COUNT]; // (µm) #endif - static inline void reset_index() { calib_idx = 0; }; - static inline uint8_t get_index() { return calib_idx; } + static void reset_index() { calib_idx = 0; }; + static uint8_t get_index() { return calib_idx; } static void reset(); static void clear_offsets(const TempSensorID tsi); - static inline void clear_all_offsets() { + static void clear_all_offsets() { TERN_(PTC_PROBE, clear_offsets(TSI_PROBE)); TERN_(PTC_BED, clear_offsets(TSI_BED)); TERN_(PTC_HOTEND, clear_offsets(TSI_EXT)); diff --git a/Marlin/src/feature/repeat.h b/Marlin/src/feature/repeat.h index 0f4d9425b768..fc11e4a9e2cf 100644 --- a/Marlin/src/feature/repeat.h +++ b/Marlin/src/feature/repeat.h @@ -38,8 +38,8 @@ class Repeat { static repeat_marker_t marker[MAX_REPEAT_NESTING]; static uint8_t index; public: - static inline void reset() { index = 0; } - static inline bool is_active() { + static void reset() { index = 0; } + static bool is_active() { LOOP_L_N(i, index) if (marker[i].counter) return true; return false; } diff --git a/Marlin/src/feature/runout.h b/Marlin/src/feature/runout.h index 8065e515559f..e74d857a79ed 100644 --- a/Marlin/src/feature/runout.h +++ b/Marlin/src/feature/runout.h @@ -83,30 +83,30 @@ class TFilamentMonitor : public FilamentMonitorBase { static sensor_t sensor; public: - static inline void setup() { + static void setup() { sensor.setup(); reset(); } - static inline void reset() { + static void reset() { filament_ran_out = false; response.reset(); } // Call this method when filament is present, // so the response can reset its counter. - static inline void filament_present(const uint8_t extruder) { + static void filament_present(const uint8_t extruder) { response.filament_present(extruder); } #if HAS_FILAMENT_RUNOUT_DISTANCE - static inline float& runout_distance() { return response.runout_distance_mm; } - static inline void set_runout_distance(const_float_t mm) { response.runout_distance_mm = mm; } + static float& runout_distance() { return response.runout_distance_mm; } + static void set_runout_distance(const_float_t mm) { response.runout_distance_mm = mm; } #endif // Handle a block completion. RunoutResponseDelayed uses this to // add up the length of filament moved while the filament is out. - static inline void block_completed(const block_t * const b) { + static void block_completed(const block_t * const b) { if (enabled) { response.block_completed(b); sensor.block_completed(b); @@ -114,7 +114,7 @@ class TFilamentMonitor : public FilamentMonitorBase { } // Give the response a chance to update its counter. - static inline void run() { + static void run() { if (enabled && !filament_ran_out && (printingIsActive() || did_pause_print)) { TERN_(HAS_FILAMENT_RUNOUT_DISTANCE, cli()); // Prevent RunoutResponseDelayed::block_completed from accumulating here response.run(); @@ -168,12 +168,12 @@ class FilamentSensorBase { * Called by FilamentSensorSwitch::run when filament is detected. * Called by FilamentSensorEncoder::block_completed when motion is detected. */ - static inline void filament_present(const uint8_t extruder) { + static void filament_present(const uint8_t extruder) { runout.filament_present(extruder); // ...which calls response.filament_present(extruder) } public: - static inline void setup() { + static void setup() { #define _INIT_RUNOUT_PIN(P,S,U,D) do{ if (ENABLED(U)) SET_INPUT_PULLUP(P); else if (ENABLED(D)) SET_INPUT_PULLDOWN(P); else SET_INPUT(P); }while(0) #define INIT_RUNOUT_PIN(N) _INIT_RUNOUT_PIN(FIL_RUNOUT##N##_PIN, FIL_RUNOUT##N##_STATE, FIL_RUNOUT##N##_PULLUP, FIL_RUNOUT##N##_PULLDOWN) #if NUM_RUNOUT_SENSORS >= 1 @@ -205,14 +205,14 @@ class FilamentSensorBase { } // Return a bitmask of runout pin states - static inline uint8_t poll_runout_pins() { + static uint8_t poll_runout_pins() { #define _OR_RUNOUT(N) | (READ(FIL_RUNOUT##N##_PIN) ? _BV((N) - 1) : 0) return (0 REPEAT_1(NUM_RUNOUT_SENSORS, _OR_RUNOUT)); #undef _OR_RUNOUT } // Return a bitmask of runout flag states (1 bits always indicates runout) - static inline uint8_t poll_runout_states() { + static uint8_t poll_runout_states() { return poll_runout_pins() ^ uint8_t(0 #if NUM_RUNOUT_SENSORS >= 1 | (FIL_RUNOUT1_STATE ? 0 : _BV(1 - 1)) @@ -254,7 +254,7 @@ class FilamentSensorBase { private: static uint8_t motion_detected; - static inline void poll_motion_sensor() { + static void poll_motion_sensor() { static uint8_t old_state; const uint8_t new_state = poll_runout_pins(), change = old_state ^ new_state; @@ -273,7 +273,7 @@ class FilamentSensorBase { } public: - static inline void block_completed(const block_t * const b) { + static void block_completed(const block_t * const b) { // If the sensor wheel has moved since the last call to // this method reset the runout counter for the extruder. if (TEST(motion_detected, b->extruder)) @@ -283,7 +283,7 @@ class FilamentSensorBase { motion_detected = 0; } - static inline void run() { poll_motion_sensor(); } + static void run() { poll_motion_sensor(); } }; #else @@ -294,7 +294,7 @@ class FilamentSensorBase { */ class FilamentSensorSwitch : public FilamentSensorBase { private: - static inline bool poll_runout_state(const uint8_t extruder) { + static bool poll_runout_state(const uint8_t extruder) { const uint8_t runout_states = poll_runout_states(); #if MULTI_FILAMENT_SENSOR if ( !TERN0(DUAL_X_CARRIAGE, idex_is_duplicating()) @@ -307,9 +307,9 @@ class FilamentSensorBase { } public: - static inline void block_completed(const block_t * const) {} + static void block_completed(const block_t * const) {} - static inline void run() { + static void run() { LOOP_L_N(s, NUM_RUNOUT_SENSORS) { const bool out = poll_runout_state(s); if (!out) filament_present(s); @@ -341,11 +341,11 @@ class FilamentSensorBase { public: static float runout_distance_mm; - static inline void reset() { + static void reset() { LOOP_L_N(i, NUM_RUNOUT_SENSORS) filament_present(i); } - static inline void run() { + static void run() { #if ENABLED(FILAMENT_RUNOUT_SENSOR_DEBUG) static millis_t t = 0; const millis_t ms = millis(); @@ -358,17 +358,17 @@ class FilamentSensorBase { #endif } - static inline uint8_t has_run_out() { + static uint8_t has_run_out() { uint8_t runout_flags = 0; LOOP_L_N(i, NUM_RUNOUT_SENSORS) if (runout_mm_countdown[i] < 0) SBI(runout_flags, i); return runout_flags; } - static inline void filament_present(const uint8_t extruder) { + static void filament_present(const uint8_t extruder) { runout_mm_countdown[extruder] = runout_distance_mm; } - static inline void block_completed(const block_t * const b) { + static void block_completed(const block_t * const b) { if (b->steps.x || b->steps.y || b->steps.z || did_pause_print) { // Allow pause purge move to re-trigger runout state // Only trigger on extrusion with XYZ movement to allow filament change and retract/recover. const uint8_t e = b->extruder; @@ -389,23 +389,23 @@ class FilamentSensorBase { static int8_t runout_count[NUM_RUNOUT_SENSORS]; public: - static inline void reset() { + static void reset() { LOOP_L_N(i, NUM_RUNOUT_SENSORS) filament_present(i); } - static inline void run() { + static void run() { LOOP_L_N(i, NUM_RUNOUT_SENSORS) if (runout_count[i] >= 0) runout_count[i]--; } - static inline uint8_t has_run_out() { + static uint8_t has_run_out() { uint8_t runout_flags = 0; LOOP_L_N(i, NUM_RUNOUT_SENSORS) if (runout_count[i] < 0) SBI(runout_flags, i); return runout_flags; } - static inline void block_completed(const block_t * const) { } + static void block_completed(const block_t * const) { } - static inline void filament_present(const uint8_t extruder) { + static void filament_present(const uint8_t extruder) { runout_count[extruder] = runout_threshold; } }; diff --git a/Marlin/src/feature/spindle_laser.h b/Marlin/src/feature/spindle_laser.h index 95d60ae48674..7a8cd2c83004 100644 --- a/Marlin/src/feature/spindle_laser.h +++ b/Marlin/src/feature/spindle_laser.h @@ -103,12 +103,12 @@ class SpindleLaser { static void init(); #if ENABLED(MARLIN_DEV_MODE) - static inline void refresh_frequency() { set_pwm_frequency(pin_t(SPINDLE_LASER_PWM_PIN), frequency); } + static void refresh_frequency() { set_pwm_frequency(pin_t(SPINDLE_LASER_PWM_PIN), frequency); } #endif // Modifying this function should update everywhere - static inline bool enabled(const cutter_power_t opwr) { return opwr > 0; } - static inline bool enabled() { return enabled(power); } + static bool enabled(const cutter_power_t opwr) { return opwr > 0; } + static bool enabled() { return enabled(power); } static void apply_power(const uint8_t inpow); @@ -124,13 +124,13 @@ class SpindleLaser { public: static void set_ocr(const uint8_t ocr); - static inline void ocr_set_power(const uint8_t ocr) { power = ocr; set_ocr(ocr); } + static void ocr_set_power(const uint8_t ocr) { power = ocr; set_ocr(ocr); } static void ocr_off(); /** * Update output for power->OCR translation */ - static inline uint8_t upower_to_ocr(const cutter_power_t upwr) { + static uint8_t upower_to_ocr(const cutter_power_t upwr) { return uint8_t( #if CUTTER_UNIT_IS(PWM255) upwr @@ -145,11 +145,11 @@ class SpindleLaser { /** * Correct power to configured range */ - static inline cutter_power_t power_to_range(const cutter_power_t pwr) { + static cutter_power_t power_to_range(const cutter_power_t pwr) { return power_to_range(pwr, _CUTTER_POWER(CUTTER_POWER_UNIT)); } - static inline cutter_power_t power_to_range(const cutter_power_t pwr, const uint8_t pwrUnit) { + static cutter_power_t power_to_range(const cutter_power_t pwr, const uint8_t pwrUnit) { static constexpr float min_pct = TERN(CUTTER_POWER_RELATIVE, 0, TERN(SPINDLE_FEATURE, round(100.0f * (SPEED_POWER_MIN) / (SPEED_POWER_MAX)), SPEED_POWER_MIN)), max_pct = TERN(SPINDLE_FEATURE, 100, SPEED_POWER_MAX); @@ -188,7 +188,7 @@ class SpindleLaser { * Enable/Disable spindle/laser * @param enable true = enable; false = disable */ - static inline void set_enabled(const bool enable) { + static void set_enabled(const bool enable) { uint8_t value = 0; if (enable) { #if ENABLED(SPINDLE_LASER_USE_PWM) @@ -203,14 +203,14 @@ class SpindleLaser { set_power(value); } - static inline void disable() { isReady = false; set_enabled(false); } + static void disable() { isReady = false; set_enabled(false); } /** * Wait for spindle to spin up or spin down * * @param on true = state to on; false = state to off. */ - static inline void power_delay(const bool on) { + static void power_delay(const bool on) { #if DISABLED(LASER_POWER_INLINE) safe_delay(on ? SPINDLE_LASER_POWERUP_DELAY : SPINDLE_LASER_POWERDOWN_DELAY); #endif @@ -220,7 +220,7 @@ class SpindleLaser { static void set_reverse(const bool reverse); static bool is_reverse() { return READ(SPINDLE_DIR_PIN) == SPINDLE_INVERT_DIR; } #else - static inline void set_reverse(const bool) {} + static void set_reverse(const bool) {} static bool is_reverse() { return false; } #endif @@ -228,7 +228,7 @@ class SpindleLaser { static void air_evac_enable(); // Turn On Cutter Vacuum or Laser Blower motor static void air_evac_disable(); // Turn Off Cutter Vacuum or Laser Blower motor static void air_evac_toggle(); // Toggle Cutter Vacuum or Laser Blower motor - static inline bool air_evac_state() { // Get current state + static bool air_evac_state() { // Get current state return (READ(AIR_EVACUATION_PIN) == AIR_EVACUATION_ACTIVE); } #endif @@ -237,13 +237,13 @@ class SpindleLaser { static void air_assist_enable(); // Turn on air assist static void air_assist_disable(); // Turn off air assist static void air_assist_toggle(); // Toggle air assist - static inline bool air_assist_state() { // Get current state + static bool air_assist_state() { // Get current state return (READ(AIR_ASSIST_PIN) == AIR_ASSIST_ACTIVE); } #endif #if HAS_LCD_MENU - static inline void enable_with_dir(const bool reverse) { + static void enable_with_dir(const bool reverse) { isReady = true; const uint8_t ocr = TERN(SPINDLE_LASER_USE_PWM, upower_to_ocr(menuPower), 255); if (menuPower) @@ -259,7 +259,7 @@ class SpindleLaser { FORCE_INLINE static void enable_same_dir() { enable_with_dir(is_reverse()); } #if ENABLED(SPINDLE_LASER_USE_PWM) - static inline void update_from_mpower() { + static void update_from_mpower() { if (isReady) power = upower_to_ocr(menuPower); unitPower = menuPower; } @@ -271,7 +271,7 @@ class SpindleLaser { * Also fires with any PWM power that was previous set * If not set defaults to 80% power */ - static inline void test_fire_pulse() { + static void test_fire_pulse() { TERN_(USE_BEEPER, buzzer.tone(30, 3000)); enable_forward(); // Turn Laser on (Spindle speak but same funct) delay(testPulse); // Delay for time set by user in pulse ms menu screen. @@ -288,7 +288,7 @@ class SpindleLaser { */ // Force disengage planner power control - static inline void inline_disable() { + static void inline_disable() { isReady = false; unitPower = 0; planner.laser_inline.status.isPlanned = false; @@ -297,7 +297,7 @@ class SpindleLaser { } // Inline modes of all other functions; all enable planner inline power control - static inline void set_inline_enabled(const bool enable) { + static void set_inline_enabled(const bool enable) { if (enable) inline_power(255); else { @@ -326,10 +326,10 @@ class SpindleLaser { #endif } - static inline void inline_direction(const bool) { /* never */ } + static void inline_direction(const bool) { /* never */ } #if ENABLED(SPINDLE_LASER_USE_PWM) - static inline void inline_ocr_power(const uint8_t ocrpwr) { + static void inline_ocr_power(const uint8_t ocrpwr) { isReady = ocrpwr > 0; planner.laser_inline.status.isEnabled = ocrpwr > 0; planner.laser_inline.power = ocrpwr; @@ -337,7 +337,7 @@ class SpindleLaser { #endif #endif // LASER_POWER_INLINE - static inline void kill() { + static void kill() { TERN_(LASER_POWER_INLINE, inline_disable()); disable(); } diff --git a/Marlin/src/feature/tmc_util.cpp b/Marlin/src/feature/tmc_util.cpp index 82c10e6e8ec2..e793b4cf222a 100644 --- a/Marlin/src/feature/tmc_util.cpp +++ b/Marlin/src/feature/tmc_util.cpp @@ -472,12 +472,8 @@ void tmc_set_report_interval(const uint16_t update_interval) { if ((report_tmc_status_interval = update_interval)) SERIAL_ECHOLNPGM("axis:pwm_scale" - #if HAS_STEALTHCHOP - "/curr_scale" - #endif - #if HAS_STALLGUARD - "/mech_load" - #endif + TERN_(HAS_STEALTHCHOP, "/curr_scale") + TERN_(HAS_STALLGUARD, "/mech_load") "|flags|warncount" ); } diff --git a/Marlin/src/feature/tmc_util.h b/Marlin/src/feature/tmc_util.h index 1f7d5cf1a543..2da425170f8f 100644 --- a/Marlin/src/feature/tmc_util.h +++ b/Marlin/src/feature/tmc_util.h @@ -45,6 +45,12 @@ constexpr uint16_t _tmc_thrs(const uint16_t msteps, const uint32_t thrs, const u return 12650000UL * msteps / (256 * thrs * spmm); } +typedef struct { + uint8_t toff; + int8_t hend; + uint8_t hstrt; +} chopper_timing_t; + template class TMCStorage { protected: @@ -297,43 +303,6 @@ class TMCMarlin : public TMC266 sgt_max = 63; }; -template -void tmc_print_current(TMC &st) { - st.printLabel(); - SERIAL_ECHOLNPGM(" driver current: ", st.getMilliamps()); -} - -#if ENABLED(MONITOR_DRIVER_STATUS) - template - void tmc_report_otpw(TMC &st) { - st.printLabel(); - SERIAL_ECHOPGM(" temperature prewarn triggered: "); - serialprint_truefalse(st.getOTPW()); - SERIAL_EOL(); - } - template - void tmc_clear_otpw(TMC &st) { - st.clear_otpw(); - st.printLabel(); - SERIAL_ECHOLNPGM(" prewarn flag cleared"); - } -#endif -#if ENABLED(HYBRID_THRESHOLD) - template - void tmc_print_pwmthrs(TMC &st) { - st.printLabel(); - SERIAL_ECHOLNPGM(" stealthChop max speed: ", st.get_pwm_thrs()); - } -#endif -#if USE_SENSORLESS - template - void tmc_print_sgt(TMC &st) { - st.printLabel(); - SERIAL_ECHOPGM(" homing sensitivity: "); - SERIAL_PRINTLN(st.homing_threshold(), PrintBase::Dec); - } -#endif - void monitor_tmc_drivers(); void test_tmc_connection(LOGICAL_AXIS_DECL(const bool, true)); diff --git a/Marlin/src/feature/twibus.h b/Marlin/src/feature/twibus.h index d2c7270303c7..806e2a147a7d 100644 --- a/Marlin/src/feature/twibus.h +++ b/Marlin/src/feature/twibus.h @@ -244,11 +244,11 @@ class TWIBus { static void debug(FSTR_P const func, char c); static void debug(FSTR_P const func, char adr[]); #else - static inline void debug(FSTR_P const, uint32_t) {} - static inline void debug(FSTR_P const, char) {} - static inline void debug(FSTR_P const, char[]) {} + static void debug(FSTR_P const, uint32_t) {} + static void debug(FSTR_P const, char) {} + static void debug(FSTR_P const, char[]) {} #endif - static inline void debug(FSTR_P const func, uint8_t v) { debug(func, (uint32_t)v); } + static void debug(FSTR_P const func, uint8_t v) { debug(func, (uint32_t)v); } }; extern TWIBus i2c; diff --git a/Marlin/src/gcode/calibrate/G425.cpp b/Marlin/src/gcode/calibrate/G425.cpp index 88c906f4937a..31e0bb258739 100644 --- a/Marlin/src/gcode/calibrate/G425.cpp +++ b/Marlin/src/gcode/calibrate/G425.cpp @@ -666,7 +666,7 @@ inline void calibrate_all_toolheads(measurements_t &m, const float uncertainty) * 1) For each nozzle, touch top and sides of object to determine object position and * nozzle offsets. Do a fast but rough search over a wider area. * 2) With the first nozzle, touch top and sides of object to determine backlash values - * for all axis (if BACKLASH_GCODE is enabled) + * for all axes (if BACKLASH_GCODE is enabled) * 3) For each nozzle, touch top and sides of object slowly to determine precise * position of object. Adjust coordinate system and nozzle offsets so probed object * location corresponds to known object location with a high degree of precision. diff --git a/Marlin/src/gcode/feature/L6470/M906.cpp b/Marlin/src/gcode/feature/L6470/M906.cpp index d058ce5501ae..ae4a46dce60e 100644 --- a/Marlin/src/gcode/feature/L6470/M906.cpp +++ b/Marlin/src/gcode/feature/L6470/M906.cpp @@ -24,6 +24,10 @@ #if HAS_L64XX +#if AXIS_COLLISION('I') + #error "M906 parameter collision with axis name." +#endif + #include "../../gcode.h" #include "../../../libs/L64XX/L64XX_Marlin.h" #include "../../../module/stepper/indirection.h" @@ -202,12 +206,11 @@ void L64XX_report_current(L64XX &motor, const L64XX_axis_t axis) { * On L6474 this sets the TVAL register (same address). * * I - select which driver(s) to change on multi-driver axis - * 0 - (default) all drivers on the axis or E0 - * 1 - monitor only X, Y, Z or E1 - * 2 - monitor only X2, Y2, Z2 or E2 - * 3 - monitor only Z3 or E3 - * 4 - monitor only Z4 or E4 - * 5 - monitor only E5 + * (default) all drivers on the axis + * 0 - monitor only the first XYZ... driver + * 1 - monitor only X2, Y2, Z2 + * 2 - monitor only Z3 + * 3 - monitor only Z4 * Xxxx, Yxxx, Zxxx, Exxx - axis to change (optional) * L6474 - current in mA (4A max) * All others - 0-255 @@ -227,8 +230,10 @@ void GcodeSuite::M906() { uint8_t report_current = true; - #if HAS_L64XX - const uint8_t index = parser.byteval('I'); + #if AXIS_IS_L64XX(X2) || AXIS_IS_L64XX(Y2) || AXIS_IS_L64XX(Z2) || AXIS_IS_L64XX(Z3) || AXIS_IS_L64XX(Z4) + const int8_t index = parser.byteval('I', -1); + #else + constexpr int8_t index = -1; #endif LOOP_LOGICAL_AXES(i) if (uint16_t value = parser.intval(axis_codes[i])) { @@ -243,20 +248,20 @@ void GcodeSuite::M906() { switch (i) { case X_AXIS: #if AXIS_IS_L64XX(X) - if (index == 0) L6470_SET_KVAL_HOLD(X); + if (index < 0 || index == 0) L6470_SET_KVAL_HOLD(X); #endif #if AXIS_IS_L64XX(X2) - if (index == 1) L6470_SET_KVAL_HOLD(X2); + if (index < 0 || index == 1) L6470_SET_KVAL_HOLD(X2); #endif break; #if HAS_Y_AXIS case Y_AXIS: #if AXIS_IS_L64XX(Y) - if (index == 0) L6470_SET_KVAL_HOLD(Y); + if (index < 0 || index == 0) L6470_SET_KVAL_HOLD(Y); #endif #if AXIS_IS_L64XX(Y2) - if (index == 1) L6470_SET_KVAL_HOLD(Y2); + if (index < 0 || index == 1) L6470_SET_KVAL_HOLD(Y2); #endif break; #endif @@ -264,50 +269,47 @@ void GcodeSuite::M906() { #if HAS_Z_AXIS case Z_AXIS: #if AXIS_IS_L64XX(Z) - if (index == 0) L6470_SET_KVAL_HOLD(Z); + if (index < 0 || index == 0) L6470_SET_KVAL_HOLD(Z); #endif #if AXIS_IS_L64XX(Z2) - if (index == 1) L6470_SET_KVAL_HOLD(Z2); + if (index < 0 || index == 1) L6470_SET_KVAL_HOLD(Z2); #endif #if AXIS_IS_L64XX(Z3) - if (index == 2) L6470_SET_KVAL_HOLD(Z3); + if (index < 0 || index == 2) L6470_SET_KVAL_HOLD(Z3); #endif #if AXIS_DRIVER_TYPE_Z4(L6470) - if (index == 3) L6470_SET_KVAL_HOLD(Z4); + if (index < 0 || index == 3) L6470_SET_KVAL_HOLD(Z4); #endif break; #endif #if E_STEPPERS case E_AXIS: { - const int8_t target_e_stepper = get_target_e_stepper_from_command(0); - if (target_e_stepper < 0) return; - switch (target_e_stepper) { - #if AXIS_IS_L64XX(E0) - case 0: L6470_SET_KVAL_HOLD(E0); break; - #endif - #if AXIS_IS_L64XX(E1) - case 1: L6470_SET_KVAL_HOLD(E1); break; - #endif - #if AXIS_IS_L64XX(E2) - case 2: L6470_SET_KVAL_HOLD(E2); break; - #endif - #if AXIS_IS_L64XX(E3) - case 3: L6470_SET_KVAL_HOLD(E3); break; - #endif - #if AXIS_IS_L64XX(E4) - case 4: L6470_SET_KVAL_HOLD(E4); break; - #endif - #if AXIS_IS_L64XX(E5) - case 5: L6470_SET_KVAL_HOLD(E5); break; - #endif - #if AXIS_IS_L64XX(E6) - case 6: L6470_SET_KVAL_HOLD(E6); break; - #endif - #if AXIS_IS_L64XX(E7) - case 7: L6470_SET_KVAL_HOLD(E7); break; - #endif - } + const int8_t eindex = get_target_e_stepper_from_command(-2); + #if AXIS_IS_L64XX(E0) + if (eindex < 0 || eindex == 0) L6470_SET_KVAL_HOLD(E0); + #endif + #if AXIS_IS_L64XX(E1) + if (eindex < 0 || eindex == 1) L6470_SET_KVAL_HOLD(E1); + #endif + #if AXIS_IS_L64XX(E2) + if (eindex < 0 || eindex == 2) L6470_SET_KVAL_HOLD(E2); + #endif + #if AXIS_IS_L64XX(E3) + if (eindex < 0 || eindex == 3) L6470_SET_KVAL_HOLD(E3); + #endif + #if AXIS_IS_L64XX(E4) + if (eindex < 0 || eindex == 4) L6470_SET_KVAL_HOLD(E4); + #endif + #if AXIS_IS_L64XX(E5) + if (eindex < 0 || eindex == 5) L6470_SET_KVAL_HOLD(E5); + #endif + #if AXIS_IS_L64XX(E6) + if (eindex < 0 || eindex == 6) L6470_SET_KVAL_HOLD(E6); + #endif + #if AXIS_IS_L64XX(E7) + if (eindex < 0 || eindex == 7) L6470_SET_KVAL_HOLD(E7); + #endif } break; #endif } diff --git a/Marlin/src/gcode/feature/L6470/M916-918.cpp b/Marlin/src/gcode/feature/L6470/M916-M918.cpp similarity index 100% rename from Marlin/src/gcode/feature/L6470/M916-918.cpp rename to Marlin/src/gcode/feature/L6470/M916-M918.cpp diff --git a/Marlin/src/gcode/feature/pause/M600.cpp b/Marlin/src/gcode/feature/pause/M600.cpp index 665967ca564d..febb946befb5 100644 --- a/Marlin/src/gcode/feature/pause/M600.cpp +++ b/Marlin/src/gcode/feature/pause/M600.cpp @@ -67,13 +67,13 @@ void GcodeSuite::M600() { #if ENABLED(MIXING_EXTRUDER) - const int8_t target_e_stepper = get_target_e_stepper_from_command(); - if (target_e_stepper < 0) return; + const int8_t eindex = get_target_e_stepper_from_command(); + if (eindex < 0) return; const uint8_t old_mixing_tool = mixer.get_current_vtool(); mixer.T(MIXER_DIRECT_SET_TOOL); - MIXER_STEPPER_LOOP(i) mixer.set_collector(i, i == uint8_t(target_e_stepper) ? 1.0 : 0.0); + MIXER_STEPPER_LOOP(i) mixer.set_collector(i, i == uint8_t(eindex) ? 1.0 : 0.0); mixer.normalize(); const int8_t target_extruder = active_extruder; diff --git a/Marlin/src/gcode/feature/pause/M701_M702.cpp b/Marlin/src/gcode/feature/pause/M701_M702.cpp index 21e389a5f201..135b3d384ec0 100644 --- a/Marlin/src/gcode/feature/pause/M701_M702.cpp +++ b/Marlin/src/gcode/feature/pause/M701_M702.cpp @@ -60,13 +60,13 @@ void GcodeSuite::M701() { if (TERN0(NO_MOTION_BEFORE_HOMING, axes_should_home())) park_point.z = 0; #if ENABLED(MIXING_EXTRUDER) - const int8_t target_e_stepper = get_target_e_stepper_from_command(); - if (target_e_stepper < 0) return; + const int8_t eindex = get_target_e_stepper_from_command(); + if (eindex < 0) return; const uint8_t old_mixing_tool = mixer.get_current_vtool(); mixer.T(MIXER_DIRECT_SET_TOOL); - MIXER_STEPPER_LOOP(i) mixer.set_collector(i, (i == (uint8_t)target_e_stepper) ? 1.0 : 0.0); + MIXER_STEPPER_LOOP(i) mixer.set_collector(i, i == uint8_t(eindex) ? 1.0 : 0.0); mixer.normalize(); const int8_t target_extruder = active_extruder; @@ -165,10 +165,10 @@ void GcodeSuite::M702() { #endif if (seenT) { - const int8_t target_e_stepper = get_target_e_stepper_from_command(); - if (target_e_stepper < 0) return; + const int8_t eindex = get_target_e_stepper_from_command(); + if (eindex < 0) return; mixer.T(MIXER_DIRECT_SET_TOOL); - MIXER_STEPPER_LOOP(i) mixer.set_collector(i, (i == (uint8_t)target_e_stepper) ? 1.0 : 0.0); + MIXER_STEPPER_LOOP(i) mixer.set_collector(i, i == uint8_t(eindex) ? 1.0 : 0.0); mixer.normalize(); } diff --git a/Marlin/src/gcode/feature/power_monitor/M430.cpp b/Marlin/src/gcode/feature/power_monitor/M430.cpp index 642a75d0612a..0f3bb4091421 100644 --- a/Marlin/src/gcode/feature/power_monitor/M430.cpp +++ b/Marlin/src/gcode/feature/power_monitor/M430.cpp @@ -53,9 +53,7 @@ void GcodeSuite::M430() { SERIAL_ECHOLNPGM( #if ENABLED(POWER_MONITOR_CURRENT) "Current: ", power_monitor.getAmps(), "A" - #if ENABLED(POWER_MONITOR_VOLTAGE) - " " - #endif + TERN_(POWER_MONITOR_VOLTAGE, " ") #endif #if ENABLED(POWER_MONITOR_VOLTAGE) "Voltage: ", power_monitor.getVolts(), "V" diff --git a/Marlin/src/gcode/feature/trinamic/M569.cpp b/Marlin/src/gcode/feature/trinamic/M569.cpp index cb33d46d2528..7bfedf8c7210 100644 --- a/Marlin/src/gcode/feature/trinamic/M569.cpp +++ b/Marlin/src/gcode/feature/trinamic/M569.cpp @@ -24,6 +24,10 @@ #if HAS_STEALTHCHOP +#if AXIS_COLLISION('I') + #error "M569 parameter collision with axis name." +#endif + #include "../../gcode.h" #include "../../../feature/tmc_util.h" #include "../../../module/stepper/indirection.h" @@ -40,35 +44,35 @@ void tmc_set_stealthChop(TMC &st, const bool enable) { st.refresh_stepping_mode(); } -static void set_stealth_status(const bool enable, const int8_t target_e_stepper) { +static void set_stealth_status(const bool enable, const int8_t eindex) { #define TMC_SET_STEALTH(Q) tmc_set_stealthChop(stepper##Q, enable) - #if X_HAS_STEALTHCHOP || Y_HAS_STEALTHCHOP || Z_HAS_STEALTHCHOP \ - || I_HAS_STEALTHCHOP || J_HAS_STEALTHCHOP || K_HAS_STEALTHCHOP \ - || X2_HAS_STEALTHCHOP || Y2_HAS_STEALTHCHOP || Z2_HAS_STEALTHCHOP || Z3_HAS_STEALTHCHOP || Z4_HAS_STEALTHCHOP - const uint8_t index = parser.byteval('I'); + #if X2_HAS_STEALTHCHOP || Y2_HAS_STEALTHCHOP || Z2_HAS_STEALTHCHOP || Z3_HAS_STEALTHCHOP || Z4_HAS_STEALTHCHOP + const int8_t index = parser.byteval('I', -1); + #else + constexpr int8_t index = -1; #endif LOOP_LOGICAL_AXES(i) if (parser.seen(axis_codes[i])) { switch (i) { case X_AXIS: - TERN_(X_HAS_STEALTHCHOP, if (index == 0) TMC_SET_STEALTH(X)); - TERN_(X2_HAS_STEALTHCHOP, if (index == 1) TMC_SET_STEALTH(X2)); + TERN_(X_HAS_STEALTHCHOP, if (index < 0 || index == 0) TMC_SET_STEALTH(X)); + TERN_(X2_HAS_STEALTHCHOP, if (index < 0 || index == 1) TMC_SET_STEALTH(X2)); break; #if HAS_Y_AXIS case Y_AXIS: - TERN_(Y_HAS_STEALTHCHOP, if (index == 0) TMC_SET_STEALTH(Y)); - TERN_(Y2_HAS_STEALTHCHOP, if (index == 1) TMC_SET_STEALTH(Y2)); + TERN_(Y_HAS_STEALTHCHOP, if (index < 0 || index == 0) TMC_SET_STEALTH(Y)); + TERN_(Y2_HAS_STEALTHCHOP, if (index < 0 || index == 1) TMC_SET_STEALTH(Y2)); break; #endif #if HAS_Z_AXIS case Z_AXIS: - TERN_(Z_HAS_STEALTHCHOP, if (index == 0) TMC_SET_STEALTH(Z)); - TERN_(Z2_HAS_STEALTHCHOP, if (index == 1) TMC_SET_STEALTH(Z2)); - TERN_(Z3_HAS_STEALTHCHOP, if (index == 2) TMC_SET_STEALTH(Z3)); - TERN_(Z4_HAS_STEALTHCHOP, if (index == 3) TMC_SET_STEALTH(Z4)); + TERN_(Z_HAS_STEALTHCHOP, if (index < 0 || index == 0) TMC_SET_STEALTH(Z)); + TERN_(Z2_HAS_STEALTHCHOP, if (index < 0 || index == 1) TMC_SET_STEALTH(Z2)); + TERN_(Z3_HAS_STEALTHCHOP, if (index < 0 || index == 2) TMC_SET_STEALTH(Z3)); + TERN_(Z4_HAS_STEALTHCHOP, if (index < 0 || index == 3) TMC_SET_STEALTH(Z4)); break; #endif @@ -84,17 +88,14 @@ static void set_stealth_status(const bool enable, const int8_t target_e_stepper) #if E_STEPPERS case E_AXIS: { - if (target_e_stepper < 0) return; - switch (target_e_stepper) { - TERN_(E0_HAS_STEALTHCHOP, case 0: TMC_SET_STEALTH(E0); break;) - TERN_(E1_HAS_STEALTHCHOP, case 1: TMC_SET_STEALTH(E1); break;) - TERN_(E2_HAS_STEALTHCHOP, case 2: TMC_SET_STEALTH(E2); break;) - TERN_(E3_HAS_STEALTHCHOP, case 3: TMC_SET_STEALTH(E3); break;) - TERN_(E4_HAS_STEALTHCHOP, case 4: TMC_SET_STEALTH(E4); break;) - TERN_(E5_HAS_STEALTHCHOP, case 5: TMC_SET_STEALTH(E5); break;) - TERN_(E6_HAS_STEALTHCHOP, case 6: TMC_SET_STEALTH(E6); break;) - TERN_(E7_HAS_STEALTHCHOP, case 7: TMC_SET_STEALTH(E7); break;) - } + TERN_(E0_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 0) TMC_SET_STEALTH(E0)); + TERN_(E1_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 1) TMC_SET_STEALTH(E1)); + TERN_(E2_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 2) TMC_SET_STEALTH(E2)); + TERN_(E3_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 3) TMC_SET_STEALTH(E3)); + TERN_(E4_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 4) TMC_SET_STEALTH(E4)); + TERN_(E5_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 5) TMC_SET_STEALTH(E5)); + TERN_(E6_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 6) TMC_SET_STEALTH(E6)); + TERN_(E7_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 7) TMC_SET_STEALTH(E7)); } break; #endif } @@ -133,7 +134,7 @@ static void say_stealth_status() { */ void GcodeSuite::M569() { if (parser.seen('S')) - set_stealth_status(parser.value_bool(), get_target_e_stepper_from_command(0)); + set_stealth_status(parser.value_bool(), get_target_e_stepper_from_command(-2)); else say_stealth_status(); } diff --git a/Marlin/src/gcode/feature/trinamic/M906.cpp b/Marlin/src/gcode/feature/trinamic/M906.cpp index f28718c831ba..788389ed61b7 100644 --- a/Marlin/src/gcode/feature/trinamic/M906.cpp +++ b/Marlin/src/gcode/feature/trinamic/M906.cpp @@ -28,6 +28,12 @@ #include "../../../feature/tmc_util.h" #include "../../../module/stepper/indirection.h" +template +static void tmc_print_current(TMC &st) { + st.printLabel(); + SERIAL_ECHOLNPGM(" driver current: ", st.getMilliamps()); +} + /** * M906: Set motor current in milliamps. * @@ -48,8 +54,10 @@ void GcodeSuite::M906() { bool report = true; - #if AXIS_IS_TMC(X) || AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z) || AXIS_IS_TMC(Z2) || AXIS_IS_TMC(Z3) || AXIS_IS_TMC(Z4) || AXIS_IS_TMC(I) || AXIS_IS_TMC(J) || AXIS_IS_TMC(K) - const uint8_t index = parser.byteval('I'); + #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2) || AXIS_IS_TMC(Z3) || AXIS_IS_TMC(Z4) + const int8_t index = parser.byteval('I', -1); + #else + constexpr int8_t index = -1; #endif LOOP_LOGICAL_AXES(i) if (uint16_t value = parser.intval(axis_codes[i])) { @@ -57,20 +65,20 @@ void GcodeSuite::M906() { switch (i) { case X_AXIS: #if AXIS_IS_TMC(X) - if (index == 0) TMC_SET_CURRENT(X); + if (index < 0 || index == 0) TMC_SET_CURRENT(X); #endif #if AXIS_IS_TMC(X2) - if (index == 1) TMC_SET_CURRENT(X2); + if (index < 0 || index == 1) TMC_SET_CURRENT(X2); #endif break; #if HAS_Y_AXIS case Y_AXIS: #if AXIS_IS_TMC(Y) - if (index == 0) TMC_SET_CURRENT(Y); + if (index < 0 || index == 0) TMC_SET_CURRENT(Y); #endif #if AXIS_IS_TMC(Y2) - if (index == 1) TMC_SET_CURRENT(Y2); + if (index < 0 || index == 1) TMC_SET_CURRENT(Y2); #endif break; #endif @@ -78,16 +86,16 @@ void GcodeSuite::M906() { #if HAS_Z_AXIS case Z_AXIS: #if AXIS_IS_TMC(Z) - if (index == 0) TMC_SET_CURRENT(Z); + if (index < 0 || index == 0) TMC_SET_CURRENT(Z); #endif #if AXIS_IS_TMC(Z2) - if (index == 1) TMC_SET_CURRENT(Z2); + if (index < 0 || index == 1) TMC_SET_CURRENT(Z2); #endif #if AXIS_IS_TMC(Z3) - if (index == 2) TMC_SET_CURRENT(Z3); + if (index < 0 || index == 2) TMC_SET_CURRENT(Z3); #endif #if AXIS_IS_TMC(Z4) - if (index == 3) TMC_SET_CURRENT(Z4); + if (index < 0 || index == 3) TMC_SET_CURRENT(Z4); #endif break; #endif @@ -104,34 +112,31 @@ void GcodeSuite::M906() { #if E_STEPPERS case E_AXIS: { - const int8_t target_e_stepper = get_target_e_stepper_from_command(0); - if (target_e_stepper < 0) return; - switch (target_e_stepper) { - #if AXIS_IS_TMC(E0) - case 0: TMC_SET_CURRENT(E0); break; - #endif - #if AXIS_IS_TMC(E1) - case 1: TMC_SET_CURRENT(E1); break; - #endif - #if AXIS_IS_TMC(E2) - case 2: TMC_SET_CURRENT(E2); break; - #endif - #if AXIS_IS_TMC(E3) - case 3: TMC_SET_CURRENT(E3); break; - #endif - #if AXIS_IS_TMC(E4) - case 4: TMC_SET_CURRENT(E4); break; - #endif - #if AXIS_IS_TMC(E5) - case 5: TMC_SET_CURRENT(E5); break; - #endif - #if AXIS_IS_TMC(E6) - case 6: TMC_SET_CURRENT(E6); break; - #endif - #if AXIS_IS_TMC(E7) - case 7: TMC_SET_CURRENT(E7); break; - #endif - } + const int8_t eindex = get_target_e_stepper_from_command(-2); + #if AXIS_IS_TMC(E0) + if (eindex < 0 || eindex == 0) TMC_SET_CURRENT(E0); + #endif + #if AXIS_IS_TMC(E1) + if (eindex < 0 || eindex == 1) TMC_SET_CURRENT(E1); + #endif + #if AXIS_IS_TMC(E2) + if (eindex < 0 || eindex == 2) TMC_SET_CURRENT(E2); + #endif + #if AXIS_IS_TMC(E3) + if (eindex < 0 || eindex == 3) TMC_SET_CURRENT(E3); + #endif + #if AXIS_IS_TMC(E4) + if (eindex < 0 || eindex == 4) TMC_SET_CURRENT(E4); + #endif + #if AXIS_IS_TMC(E5) + if (eindex < 0 || eindex == 5) TMC_SET_CURRENT(E5); + #endif + #if AXIS_IS_TMC(E6) + if (eindex < 0 || eindex == 6) TMC_SET_CURRENT(E6); + #endif + #if AXIS_IS_TMC(E7) + if (eindex < 0 || eindex == 7) TMC_SET_CURRENT(E7); + #endif } break; #endif } diff --git a/Marlin/src/gcode/feature/trinamic/M911-M914.cpp b/Marlin/src/gcode/feature/trinamic/M911-M914.cpp index 3f83558fd428..37dd9479aba3 100644 --- a/Marlin/src/gcode/feature/trinamic/M911-M914.cpp +++ b/Marlin/src/gcode/feature/trinamic/M911-M914.cpp @@ -62,6 +62,21 @@ #error "MONITOR_DRIVER_STATUS requires at least one TMC2130, 2160, 2208, 2209, 2660, 5130, or 5160." #endif + template + static void tmc_report_otpw(TMC &st) { + st.printLabel(); + SERIAL_ECHOPGM(" temperature prewarn triggered: "); + serialprint_truefalse(st.getOTPW()); + SERIAL_EOL(); + } + + template + static void tmc_clear_otpw(TMC &st) { + st.clear_otpw(); + st.printLabel(); + SERIAL_ECHOLNPGM(" prewarn flag cleared"); + } + /** * M911: Report TMC stepper driver overtemperature pre-warn flag * This flag is held by the library, persisting until cleared by M912 @@ -223,11 +238,17 @@ #endif // MONITOR_DRIVER_STATUS -/** - * M913: Set HYBRID_THRESHOLD speed. - */ #if ENABLED(HYBRID_THRESHOLD) + template + static void tmc_print_pwmthrs(TMC &st) { + st.printLabel(); + SERIAL_ECHOLNPGM(" stealthChop max speed: ", st.get_pwm_thrs()); + } + + /** + * M913: Set HYBRID_THRESHOLD speed. + */ void GcodeSuite::M913() { #define TMC_SAY_PWMTHRS(A,Q) tmc_print_pwmthrs(stepper##Q) #define TMC_SET_PWMTHRS(A,Q) stepper##Q.set_pwm_thrs(value) @@ -235,19 +256,21 @@ #define TMC_SET_PWMTHRS_E(E) stepperE##E.set_pwm_thrs(value) bool report = true; - #if AXIS_IS_TMC(X) || AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z) || AXIS_IS_TMC(Z2) || AXIS_IS_TMC(Z3) || AXIS_IS_TMC(Z4) || AXIS_IS_TMC(I) || AXIS_IS_TMC(J) || AXIS_IS_TMC(K) - const uint8_t index = parser.byteval('I'); + #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2) || AXIS_IS_TMC(Z3) || AXIS_IS_TMC(Z4) + const int8_t index = parser.byteval('I', -1); + #else + constexpr int8_t index = -1; #endif LOOP_LOGICAL_AXES(i) if (int32_t value = parser.longval(axis_codes[i])) { report = false; switch (i) { case X_AXIS: - TERN_(X_HAS_STEALTHCHOP, if (index < 2) TMC_SET_PWMTHRS(X,X)); - TERN_(X2_HAS_STEALTHCHOP, if (!(index & 1)) TMC_SET_PWMTHRS(X,X2)); + TERN_(X_HAS_STEALTHCHOP, if (index < 0 || index == 0) TMC_SET_PWMTHRS(X,X)); + TERN_(X2_HAS_STEALTHCHOP, if (index < 0 || index == 1) TMC_SET_PWMTHRS(X,X2)); break; case Y_AXIS: - TERN_(Y_HAS_STEALTHCHOP, if (index < 2) TMC_SET_PWMTHRS(Y,Y)); - TERN_(Y2_HAS_STEALTHCHOP, if (!(index & 1)) TMC_SET_PWMTHRS(Y,Y2)); + TERN_(Y_HAS_STEALTHCHOP, if (index < 0 || index == 0) TMC_SET_PWMTHRS(Y,Y)); + TERN_(Y2_HAS_STEALTHCHOP, if (index < 0 || index == 1) TMC_SET_PWMTHRS(Y,Y2)); break; #if I_HAS_STEALTHCHOP @@ -261,25 +284,22 @@ #endif case Z_AXIS: - TERN_(Z_HAS_STEALTHCHOP, if (index < 2) TMC_SET_PWMTHRS(Z,Z)); - TERN_(Z2_HAS_STEALTHCHOP, if (index == 0 || index == 2) TMC_SET_PWMTHRS(Z,Z2)); - TERN_(Z3_HAS_STEALTHCHOP, if (index == 0 || index == 3) TMC_SET_PWMTHRS(Z,Z3)); - TERN_(Z4_HAS_STEALTHCHOP, if (index == 0 || index == 4) TMC_SET_PWMTHRS(Z,Z4)); + TERN_(Z_HAS_STEALTHCHOP, if (index < 0 || index == 0) TMC_SET_PWMTHRS(Z,Z)); + TERN_(Z2_HAS_STEALTHCHOP, if (index < 0 || index == 1) TMC_SET_PWMTHRS(Z,Z2)); + TERN_(Z3_HAS_STEALTHCHOP, if (index < 0 || index == 2) TMC_SET_PWMTHRS(Z,Z3)); + TERN_(Z4_HAS_STEALTHCHOP, if (index < 0 || index == 3) TMC_SET_PWMTHRS(Z,Z4)); break; #if E_STEPPERS case E_AXIS: { - const int8_t target_e_stepper = get_target_e_stepper_from_command(0); - if (target_e_stepper < 0) return; - switch (target_e_stepper) { - TERN_(E0_HAS_STEALTHCHOP, case 0: TMC_SET_PWMTHRS_E(0); break;) - TERN_(E1_HAS_STEALTHCHOP, case 1: TMC_SET_PWMTHRS_E(1); break;) - TERN_(E2_HAS_STEALTHCHOP, case 2: TMC_SET_PWMTHRS_E(2); break;) - TERN_(E3_HAS_STEALTHCHOP, case 3: TMC_SET_PWMTHRS_E(3); break;) - TERN_(E4_HAS_STEALTHCHOP, case 4: TMC_SET_PWMTHRS_E(4); break;) - TERN_(E5_HAS_STEALTHCHOP, case 5: TMC_SET_PWMTHRS_E(5); break;) - TERN_(E6_HAS_STEALTHCHOP, case 6: TMC_SET_PWMTHRS_E(6); break;) - TERN_(E7_HAS_STEALTHCHOP, case 7: TMC_SET_PWMTHRS_E(7); break;) - } + const int8_t eindex = get_target_e_stepper_from_command(-2); + TERN_(E0_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 0) TMC_SET_PWMTHRS_E(0)); + TERN_(E1_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 1) TMC_SET_PWMTHRS_E(1)); + TERN_(E2_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 2) TMC_SET_PWMTHRS_E(2)); + TERN_(E3_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 3) TMC_SET_PWMTHRS_E(3)); + TERN_(E4_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 4) TMC_SET_PWMTHRS_E(4)); + TERN_(E5_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 5) TMC_SET_PWMTHRS_E(5)); + TERN_(E6_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 6) TMC_SET_PWMTHRS_E(6)); + TERN_(E7_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 7) TMC_SET_PWMTHRS_E(7)); } break; #endif // E_STEPPERS } @@ -407,11 +427,18 @@ #endif // HYBRID_THRESHOLD -/** - * M914: Set StallGuard sensitivity. - */ #if USE_SENSORLESS + template + static void tmc_print_sgt(TMC &st) { + st.printLabel(); + SERIAL_ECHOPGM(" homing sensitivity: "); + SERIAL_PRINTLN(st.homing_threshold(), PrintBase::Dec); + } + + /** + * M914: Set StallGuard sensitivity. + */ void GcodeSuite::M914() { bool report = true; diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index c05ac5494d5a..2f031b3b74f6 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -148,6 +148,7 @@ int8_t GcodeSuite::get_target_extruder_from_command() { int8_t GcodeSuite::get_target_e_stepper_from_command(const int8_t dval/*=-1*/) { const int8_t e = parser.intval('T', dval); if (WITHIN(e, 0, E_STEPPERS - 1)) return e; + if (dval == -2) return dval; SERIAL_ECHO_START(); SERIAL_CHAR('M'); SERIAL_ECHO(parser.codenum); @@ -159,7 +160,7 @@ int8_t GcodeSuite::get_target_e_stepper_from_command(const int8_t dval/*=-1*/) { } /** - * Set XYZIJKE destination and feedrate from the current GCode command + * Set XYZ...E destination and feedrate from the current GCode command * * - Set destination from included axis codes * - Set to current for missing axis codes diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index bbfb31a3fece..92c1459a326c 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -284,7 +284,7 @@ * M871 - Print/reset/clear first layer temperature offset values. (Requires PTC_PROBE, PTC_BED, or PTC_HOTEND) * M876 - Handle Prompt Response. (Requires HOST_PROMPT_SUPPORT and not EMERGENCY_PARSER) * M900 - Get or Set Linear Advance K-factor. (Requires LIN_ADVANCE) - * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. (Requires at least one _DRIVER_TYPE defined as TMC2130/2160/5130/5160/2208/2209/2660 or L6470) + * M906 - Set or get motor current in milliamps using axis codes XYZE, etc. Report values if no axis codes given. (Requires at least one _DRIVER_TYPE defined as TMC2130/2160/5130/5160/2208/2209/2660 or L6470) * M907 - Set digital trimpot motor current using axis codes. (Requires a board with digital trimpots) * M908 - Control digital trimpot directly. (Requires HAS_MOTOR_CURRENT_DAC or DIGIPOTSS_PIN) * M909 - Print digipot/DAC current value. (Requires HAS_MOTOR_CURRENT_DAC) @@ -349,7 +349,7 @@ class GcodeSuite { static axis_bits_t axis_relative; - static inline bool axis_is_relative(const AxisEnum a) { + static bool axis_is_relative(const AxisEnum a) { #if HAS_EXTRUDERS if (a == E_AXIS) { if (TEST(axis_relative, E_MODE_REL)) return true; @@ -358,7 +358,7 @@ class GcodeSuite { #endif return TEST(axis_relative, a); } - static inline void set_relative_mode(const bool rel) { + static void set_relative_mode(const bool rel) { axis_relative = rel ? (0 LOGICAL_AXIS_GANG( | _BV(REL_E), | _BV(REL_X), | _BV(REL_Y), | _BV(REL_Z), @@ -366,11 +366,11 @@ class GcodeSuite { )) : 0; } #if HAS_EXTRUDERS - static inline void set_e_relative() { + static void set_e_relative() { CBI(axis_relative, E_MODE_ABS); SBI(axis_relative, E_MODE_REL); } - static inline void set_e_absolute() { + static void set_e_absolute() { CBI(axis_relative, E_MODE_REL); SBI(axis_relative, E_MODE_ABS); } @@ -403,7 +403,7 @@ class GcodeSuite { static void report_echo_start(const bool forReplay); static void report_heading(const bool forReplay, FSTR_P const fstr, const bool eol=true); - static inline void report_heading_etc(const bool forReplay, FSTR_P const fstr, const bool eol=true) { + static void report_heading_etc(const bool forReplay, FSTR_P const fstr, const bool eol=true) { report_heading(forReplay, fstr, eol); report_echo_start(forReplay); } @@ -420,20 +420,20 @@ class GcodeSuite { static void process_subcommands_now(FSTR_P fgcode); static void process_subcommands_now(char * gcode); - static inline void home_all_axes(const bool keep_leveling=false) { + static void home_all_axes(const bool keep_leveling=false) { process_subcommands_now(keep_leveling ? FPSTR(G28_STR) : TERN(CAN_SET_LEVELING_AFTER_G28, F("G28L0"), FPSTR(G28_STR))); } #if EITHER(HAS_AUTO_REPORTING, HOST_KEEPALIVE_FEATURE) static bool autoreport_paused; - static inline bool set_autoreport_paused(const bool p) { + static bool set_autoreport_paused(const bool p) { const bool was = autoreport_paused; autoreport_paused = p; return was; } #else static constexpr bool autoreport_paused = false; - static inline bool set_autoreport_paused(const bool) { return false; } + static bool set_autoreport_paused(const bool) { return false; } #endif #if ENABLED(HOST_KEEPALIVE_FEATURE) @@ -453,7 +453,7 @@ class GcodeSuite { static uint8_t host_keepalive_interval; static void host_keepalive(); - static inline bool host_keepalive_is_paused() { return busy_state >= PAUSED_FOR_USER; } + static bool host_keepalive_is_paused() { return busy_state >= PAUSED_FOR_USER; } #define KEEPALIVE_STATE(N) REMEMBER(_KA_, gcode.busy_state, gcode.N) #else diff --git a/Marlin/src/gcode/motion/G5.cpp b/Marlin/src/gcode/motion/G5.cpp index 2c98fae84522..316a59b6506c 100644 --- a/Marlin/src/gcode/motion/G5.cpp +++ b/Marlin/src/gcode/motion/G5.cpp @@ -24,6 +24,10 @@ #if ENABLED(BEZIER_CURVE_SUPPORT) +#if AXIS_COLLISION('I') || AXIS_COLLISION('J') + #error "G5 parameter collision with axis name." +#endif + #include "../../module/motion.h" #include "../../module/planner_bezier.h" diff --git a/Marlin/src/gcode/parser.h b/Marlin/src/gcode/parser.h index 83fda5483608..bd0846729883 100644 --- a/Marlin/src/gcode/parser.h +++ b/Marlin/src/gcode/parser.h @@ -126,7 +126,7 @@ class GCodeParser { } // Set the flag and pointer for a parameter - static inline void set(const char c, char * const ptr) { + static void set(const char c, char * const ptr) { const uint8_t ind = LETTER_BIT(c); if (ind >= COUNT(param)) return; // Only A-Z SBI32(codebits, ind); // parameter exists @@ -142,7 +142,7 @@ class GCodeParser { // Code seen bit was set. If not found, value_ptr is unchanged. // This allows "if (seen('A')||seen('B'))" to use the last-found value. - static inline bool seen(const char c) { + static bool seen(const char c) { const uint8_t ind = LETTER_BIT(c); if (ind >= COUNT(param)) return false; // Only A-Z const bool b = TEST32(codebits, ind); @@ -183,7 +183,7 @@ class GCodeParser { } #endif - static inline bool seen_any() { return !!codebits; } + static bool seen_any() { return !!codebits; } FORCE_INLINE static bool seen_test(const char c) { return TEST32(codebits, LETTER_BIT(c)); } @@ -204,19 +204,19 @@ class GCodeParser { // Code is found in the string. If not found, value_ptr is unchanged. // This allows "if (seen('A')||seen('B'))" to use the last-found value. - static inline bool seen(const char c) { + static bool seen(const char c) { char *p = strgchr(command_args, c); const bool b = !!p; if (b) value_ptr = valid_number(&p[1]) ? &p[1] : nullptr; return b; } - static inline bool seen_any() { return *command_args == '\0'; } + static bool seen_any() { return *command_args == '\0'; } FORCE_INLINE static bool seen_test(const char c) { return (bool)strgchr(command_args, c); } // At least one of a list of code letters was seen - static inline bool seen(const char * const str) { + static bool seen(const char * const str) { for (uint8_t i = 0; const char c = str[i]; i++) if (seen_test(c)) return true; return false; @@ -225,7 +225,7 @@ class GCodeParser { #endif // !FASTER_GCODE_PARSER // Seen any axis parameter - static inline bool seen_axis() { return seen(LOGICAL_AXES_STRING); } + static bool seen_axis() { return seen(LOGICAL_AXES_STRING); } #if ENABLED(GCODE_QUOTED_STRINGS) static char* unescape_string(char* &src); @@ -243,19 +243,19 @@ class GCodeParser { #endif // Test whether the parsed command matches the input - static inline bool is_command(const char ltr, const uint16_t num) { return command_letter == ltr && codenum == num; } + static bool is_command(const char ltr, const uint16_t num) { return command_letter == ltr && codenum == num; } // The code value pointer was set FORCE_INLINE static bool has_value() { return !!value_ptr; } // Seen a parameter with a value - static inline bool seenval(const char c) { return seen(c) && has_value(); } + static bool seenval(const char c) { return seen(c) && has_value(); } // The value as a string - static inline char* value_string() { return value_ptr; } + static char* value_string() { return value_ptr; } // Float removes 'E' to prevent scientific notation interpretation - static inline float value_float() { + static float value_float() { if (value_ptr) { char *e = value_ptr; for (;;) { @@ -275,31 +275,31 @@ class GCodeParser { } // Code value as a long or ulong - static inline int32_t value_long() { return value_ptr ? strtol(value_ptr, nullptr, 10) : 0L; } - static inline uint32_t value_ulong() { return value_ptr ? strtoul(value_ptr, nullptr, 10) : 0UL; } + static int32_t value_long() { return value_ptr ? strtol(value_ptr, nullptr, 10) : 0L; } + static uint32_t value_ulong() { return value_ptr ? strtoul(value_ptr, nullptr, 10) : 0UL; } // Code value for use as time - static inline millis_t value_millis() { return value_ulong(); } - static inline millis_t value_millis_from_seconds() { return (millis_t)SEC_TO_MS(value_float()); } + static millis_t value_millis() { return value_ulong(); } + static millis_t value_millis_from_seconds() { return (millis_t)SEC_TO_MS(value_float()); } // Reduce to fewer bits - static inline int16_t value_int() { return (int16_t)value_long(); } - static inline uint16_t value_ushort() { return (uint16_t)value_long(); } - static inline uint8_t value_byte() { return (uint8_t)constrain(value_long(), 0, 255); } + static int16_t value_int() { return (int16_t)value_long(); } + static uint16_t value_ushort() { return (uint16_t)value_long(); } + static uint8_t value_byte() { return (uint8_t)constrain(value_long(), 0, 255); } // Bool is true with no value or non-zero - static inline bool value_bool() { return !has_value() || !!value_byte(); } + static bool value_bool() { return !has_value() || !!value_byte(); } // Units modes: Inches, Fahrenheit, Kelvin #if ENABLED(INCH_MODE_SUPPORT) - static inline float mm_to_linear_unit(const_float_t mm) { return mm / linear_unit_factor; } - static inline float mm_to_volumetric_unit(const_float_t mm) { return mm / (volumetric_enabled ? volumetric_unit_factor : linear_unit_factor); } + static float mm_to_linear_unit(const_float_t mm) { return mm / linear_unit_factor; } + static float mm_to_volumetric_unit(const_float_t mm) { return mm / (volumetric_enabled ? volumetric_unit_factor : linear_unit_factor); } // Init linear units by constructor GCodeParser() { set_input_linear_units(LINEARUNIT_MM); } - static inline void set_input_linear_units(const LinearUnit units) { + static void set_input_linear_units(const LinearUnit units) { switch (units) { default: case LINEARUNIT_MM: linear_unit_factor = 1.0f; break; @@ -308,7 +308,7 @@ class GCodeParser { volumetric_unit_factor = POW(linear_unit_factor, 3); } - static inline float axis_unit_factor(const AxisEnum axis) { + static float axis_unit_factor(const AxisEnum axis) { return ( #if HAS_EXTRUDERS axis >= E_AXIS && volumetric_enabled ? volumetric_unit_factor : linear_unit_factor @@ -318,46 +318,46 @@ class GCodeParser { ); } - static inline float linear_value_to_mm(const_float_t v) { return v * linear_unit_factor; } - static inline float axis_value_to_mm(const AxisEnum axis, const float v) { return v * axis_unit_factor(axis); } - static inline float per_axis_value(const AxisEnum axis, const float v) { return v / axis_unit_factor(axis); } + static float linear_value_to_mm(const_float_t v) { return v * linear_unit_factor; } + static float axis_value_to_mm(const AxisEnum axis, const float v) { return v * axis_unit_factor(axis); } + static float per_axis_value(const AxisEnum axis, const float v) { return v / axis_unit_factor(axis); } #else - static inline float mm_to_linear_unit(const_float_t mm) { return mm; } - static inline float mm_to_volumetric_unit(const_float_t mm) { return mm; } + static float mm_to_linear_unit(const_float_t mm) { return mm; } + static float mm_to_volumetric_unit(const_float_t mm) { return mm; } - static inline float linear_value_to_mm(const_float_t v) { return v; } - static inline float axis_value_to_mm(const AxisEnum, const float v) { return v; } - static inline float per_axis_value(const AxisEnum, const float v) { return v; } + static float linear_value_to_mm(const_float_t v) { return v; } + static float axis_value_to_mm(const AxisEnum, const float v) { return v; } + static float per_axis_value(const AxisEnum, const float v) { return v; } #endif - static inline bool using_inch_units() { return mm_to_linear_unit(1.0f) != 1.0f; } + static bool using_inch_units() { return mm_to_linear_unit(1.0f) != 1.0f; } #define IN_TO_MM(I) ((I) * 25.4f) #define MM_TO_IN(M) ((M) / 25.4f) #define LINEAR_UNIT(V) parser.mm_to_linear_unit(V) #define VOLUMETRIC_UNIT(V) parser.mm_to_volumetric_unit(V) - static inline float value_linear_units() { return linear_value_to_mm(value_float()); } - static inline float value_axis_units(const AxisEnum axis) { return axis_value_to_mm(axis, value_float()); } - static inline float value_per_axis_units(const AxisEnum axis) { return per_axis_value(axis, value_float()); } + static float value_linear_units() { return linear_value_to_mm(value_float()); } + static float value_axis_units(const AxisEnum axis) { return axis_value_to_mm(axis, value_float()); } + static float value_per_axis_units(const AxisEnum axis) { return per_axis_value(axis, value_float()); } #if ENABLED(TEMPERATURE_UNITS_SUPPORT) - static inline void set_input_temp_units(const TempUnit units) { input_temp_units = units; } + static void set_input_temp_units(const TempUnit units) { input_temp_units = units; } - static inline char temp_units_code() { + static char temp_units_code() { return input_temp_units == TEMPUNIT_K ? 'K' : input_temp_units == TEMPUNIT_F ? 'F' : 'C'; } - static inline FSTR_P temp_units_name() { + static FSTR_P temp_units_name() { return input_temp_units == TEMPUNIT_K ? F("Kelvin") : input_temp_units == TEMPUNIT_F ? F("Fahrenheit") : F("Celsius"); } #if HAS_LCD_MENU && DISABLED(DISABLE_M503) - static inline float to_temp_units(celsius_t c) { + static float to_temp_units(celsius_t c) { switch (input_temp_units) { default: case TEMPUNIT_C: return c; @@ -368,7 +368,7 @@ class GCodeParser { #endif // HAS_LCD_MENU && !DISABLE_M503 - static inline celsius_t value_celsius() { + static celsius_t value_celsius() { float f = value_float(); switch (input_temp_units) { default: @@ -379,7 +379,7 @@ class GCodeParser { return LROUND(f); } - static inline celsius_t value_celsius_diff() { + static celsius_t value_celsius_diff() { float f = value_float(); switch (input_temp_units) { default: @@ -392,35 +392,35 @@ class GCodeParser { #else // !TEMPERATURE_UNITS_SUPPORT - static inline float to_temp_units(int16_t c) { return (float)c; } + static float to_temp_units(int16_t c) { return (float)c; } - static inline celsius_t value_celsius() { return value_int(); } - static inline celsius_t value_celsius_diff() { return value_int(); } + static celsius_t value_celsius() { return value_int(); } + static celsius_t value_celsius_diff() { return value_int(); } #endif // !TEMPERATURE_UNITS_SUPPORT - static inline feedRate_t value_feedrate() { return MMM_TO_MMS(value_linear_units()); } + static feedRate_t value_feedrate() { return MMM_TO_MMS(value_linear_units()); } void unknown_command_warning(); // Provide simple value accessors with default option - static inline char* stringval(const char c, char * const dval=nullptr) { return seenval(c) ? value_string() : dval; } - static inline float floatval(const char c, const float dval=0.0) { return seenval(c) ? value_float() : dval; } - static inline bool boolval(const char c, const bool dval=false) { return seenval(c) ? value_bool() : (seen(c) ? true : dval); } - static inline uint8_t byteval(const char c, const uint8_t dval=0) { return seenval(c) ? value_byte() : dval; } - static inline int16_t intval(const char c, const int16_t dval=0) { return seenval(c) ? value_int() : dval; } - static inline uint16_t ushortval(const char c, const uint16_t dval=0) { return seenval(c) ? value_ushort() : dval; } - static inline int32_t longval(const char c, const int32_t dval=0) { return seenval(c) ? value_long() : dval; } - static inline uint32_t ulongval(const char c, const uint32_t dval=0) { return seenval(c) ? value_ulong() : dval; } - static inline float linearval(const char c, const float dval=0) { return seenval(c) ? value_linear_units() : dval; } - static inline float axisunitsval(const char c, const AxisEnum a, const float dval=0) + static char* stringval(const char c, char * const dval=nullptr) { return seenval(c) ? value_string() : dval; } + static float floatval(const char c, const float dval=0.0) { return seenval(c) ? value_float() : dval; } + static bool boolval(const char c, const bool dval=false) { return seenval(c) ? value_bool() : (seen(c) ? true : dval); } + static uint8_t byteval(const char c, const uint8_t dval=0) { return seenval(c) ? value_byte() : dval; } + static int16_t intval(const char c, const int16_t dval=0) { return seenval(c) ? value_int() : dval; } + static uint16_t ushortval(const char c, const uint16_t dval=0) { return seenval(c) ? value_ushort() : dval; } + static int32_t longval(const char c, const int32_t dval=0) { return seenval(c) ? value_long() : dval; } + static uint32_t ulongval(const char c, const uint32_t dval=0) { return seenval(c) ? value_ulong() : dval; } + static float linearval(const char c, const float dval=0) { return seenval(c) ? value_linear_units() : dval; } + static float axisunitsval(const char c, const AxisEnum a, const float dval=0) { return seenval(c) ? value_axis_units(a) : dval; } - static inline celsius_t celsiusval(const char c, const celsius_t dval=0) { return seenval(c) ? value_celsius() : dval; } - static inline feedRate_t feedrateval(const char c, const feedRate_t dval=0) { return seenval(c) ? value_feedrate() : dval; } + static celsius_t celsiusval(const char c, const celsius_t dval=0) { return seenval(c) ? value_celsius() : dval; } + static feedRate_t feedrateval(const char c, const feedRate_t dval=0) { return seenval(c) ? value_feedrate() : dval; } #if ENABLED(MARLIN_DEV_MODE) - static inline uint8_t* hex_adr_val(const char c, uint8_t * const dval=nullptr) { + static uint8_t* hex_adr_val(const char c, uint8_t * const dval=nullptr) { if (!seen(c) || *value_ptr != 'x') return dval; uint8_t *out = nullptr; for (char *vp = value_ptr + 1; HEXCHR(*vp) >= 0; vp++) @@ -428,7 +428,7 @@ class GCodeParser { return out; } - static inline uint16_t hex_val(const char c, uint16_t const dval=0) { + static uint16_t hex_val(const char c, uint16_t const dval=0) { if (!seen(c) || *value_ptr != 'x') return dval; uint16_t out = 0; for (char *vp = value_ptr + 1; HEXCHR(*vp) >= 0; vp++) diff --git a/Marlin/src/gcode/queue.h b/Marlin/src/gcode/queue.h index 82e2a7a0e4da..1a2baaa6bbc4 100644 --- a/Marlin/src/gcode/queue.h +++ b/Marlin/src/gcode/queue.h @@ -126,14 +126,14 @@ class GCodeQueue { * Don't inject comments or use leading spaces! * Aborts the current PROGMEM queue so only use for one or two commands. */ - static inline void inject_P(PGM_P const pgcode) { injected_commands_P = pgcode; } - static inline void inject(FSTR_P const fgcode) { inject_P(FTOP(fgcode)); } + static void inject_P(PGM_P const pgcode) { injected_commands_P = pgcode; } + static void inject(FSTR_P const fgcode) { inject_P(FTOP(fgcode)); } /** * Enqueue command(s) to run from SRAM. Drained by process_injected_command(). * Aborts the current SRAM queue so only use for one or two commands. */ - static inline void inject(const char * const gcode) { + static void inject(const char * const gcode) { strncpy(injected_commands, gcode, sizeof(injected_commands) - 1); } @@ -158,7 +158,7 @@ class GCodeQueue { * Enqueue from program memory and return only when commands are actually enqueued */ static void enqueue_now_P(PGM_P const pcmd); - static inline void enqueue_now(FSTR_P const fcmd) { enqueue_now_P(FTOP(fcmd)); } + static void enqueue_now(FSTR_P const fcmd) { enqueue_now_P(FTOP(fcmd)); } /** * Check whether there are any commands yet to be executed @@ -192,7 +192,7 @@ class GCodeQueue { * P Planner space remaining * B Block queue space remaining */ - static inline void ok_to_send() { ring_buffer.ok_to_send(); } + static void ok_to_send() { ring_buffer.ok_to_send(); } /** * Clear the serial line and request a resend of @@ -203,7 +203,7 @@ class GCodeQueue { /** * (Re)Set the current line number for the last received command */ - static inline void set_current_line_number(long n) { serial_state[ring_buffer.command_port().index].last_N = n; } + static void set_current_line_number(long n) { serial_state[ring_buffer.command_port().index].last_N = n; } #if ENABLED(BUFFER_MONITORING) @@ -237,7 +237,7 @@ class GCodeQueue { static void auto_report_buffer_statistics(); - static inline void set_auto_report_interval(uint8_t v) { + static void set_auto_report_interval(uint8_t v) { NOMORE(v, 60); auto_buffer_report_interval = v; next_buffer_report_ms = millis() + 1000UL * v; diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 50191dd201e9..4cd16d44842c 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -824,7 +824,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "LCD_PROGRESS_BAR requires SDSUPPORT or LCD_SET_PROGRESS_MANUALLY." #elif NONE(HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL) #error "LCD_PROGRESS_BAR only applies to HD44780 character LCD and TFTGLCD_PANEL_(SPI|I2C)." - #elif HAS_MARLINUI_U8GLIB + #elif HAS_MARLINUI_U8GLIB || IS_DWIN_MARLINUI #error "LCD_PROGRESS_BAR does not apply to graphical displays." #elif ENABLED(FILAMENT_LCD_DISPLAY) #error "LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both." @@ -2008,8 +2008,12 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif #endif -#if HAS_FAN0 && CONTROLLER_FAN_PIN == FAN_PIN - #error "You cannot set CONTROLLER_FAN_PIN equal to FAN_PIN." +#if HAS_FAN0 + #if CONTROLLER_FAN_PIN == FAN_PIN + #error "You cannot set CONTROLLER_FAN_PIN equal to FAN_PIN." + #elif ENABLED(FAN_SOFT_PWM_REQUIRED) && DISABLED(FAN_SOFT_PWM) + #error "FAN_SOFT_PWM is required. Enable it to continue." + #endif #endif #if ENABLED(USE_CONTROLLER_FAN) @@ -3691,7 +3695,7 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive."); #error "COOLANT_FLOOD requires COOLANT_FLOOD_PIN to be defined." #endif -#if NONE(HAS_MARLINUI_U8GLIB, EXTENSIBLE_UI) && ENABLED(PRINT_PROGRESS_SHOW_DECIMALS) +#if NONE(HAS_MARLINUI_U8GLIB, EXTENSIBLE_UI, IS_DWIN_MARLINUI) && ENABLED(PRINT_PROGRESS_SHOW_DECIMALS) #error "PRINT_PROGRESS_SHOW_DECIMALS currently requires a Graphical LCD." #endif diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index c2963ee8327c..9f865bf5b5f5 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2021-12-28" + #define STRING_DISTRIBUTION_DATE "2021-12-31" #endif /** diff --git a/Marlin/src/lcd/buttons.h b/Marlin/src/lcd/buttons.h index 6d028e9bc65a..429fb971ec83 100644 --- a/Marlin/src/lcd/buttons.h +++ b/Marlin/src/lcd/buttons.h @@ -45,36 +45,6 @@ #define ENCODER_PHASE_3 1 #endif -#if IS_RRW_KEYPAD - #define BTN_OFFSET 0 // Bit offset into buttons for shift register values - - #define BLEN_KEYPAD_F3 0 - #define BLEN_KEYPAD_F2 1 - #define BLEN_KEYPAD_F1 2 - #define BLEN_KEYPAD_DOWN 3 - #define BLEN_KEYPAD_RIGHT 4 - #define BLEN_KEYPAD_MIDDLE 5 - #define BLEN_KEYPAD_UP 6 - #define BLEN_KEYPAD_LEFT 7 - - #define EN_KEYPAD_F1 _BV(BTN_OFFSET + BLEN_KEYPAD_F1) - #define EN_KEYPAD_F2 _BV(BTN_OFFSET + BLEN_KEYPAD_F2) - #define EN_KEYPAD_F3 _BV(BTN_OFFSET + BLEN_KEYPAD_F3) - #define EN_KEYPAD_DOWN _BV(BTN_OFFSET + BLEN_KEYPAD_DOWN) - #define EN_KEYPAD_RIGHT _BV(BTN_OFFSET + BLEN_KEYPAD_RIGHT) - #define EN_KEYPAD_MIDDLE _BV(BTN_OFFSET + BLEN_KEYPAD_MIDDLE) - #define EN_KEYPAD_UP _BV(BTN_OFFSET + BLEN_KEYPAD_UP) - #define EN_KEYPAD_LEFT _BV(BTN_OFFSET + BLEN_KEYPAD_LEFT) - - #define RRK(B) (keypad_buttons & (B)) - - #ifdef EN_C - #define BUTTON_CLICK() ((buttons & EN_C) || RRK(EN_KEYPAD_MIDDLE)) - #else - #define BUTTON_CLICK() RRK(EN_KEYPAD_MIDDLE) - #endif -#endif - #if EITHER(HAS_DIGITAL_BUTTONS, HAS_DWIN_E3V2) // Wheel spin pins where BA is 00, 10, 11, 01 (1 bit always changes) #define BLEN_A 0 @@ -141,7 +111,39 @@ #define B_ST _BV(BL_ST) #ifndef BUTTON_CLICK - #define BUTTON_CLICK() (buttons & (B_MI|B_ST)) + #if EN_C + #define BUTTON_CLICK() (buttons & (B_MI|B_ST)) + #endif + #endif +#endif + +#if IS_RRW_KEYPAD + #define BTN_OFFSET 0 // Bit offset into buttons for shift register values + + #define BLEN_KEYPAD_F3 0 + #define BLEN_KEYPAD_F2 1 + #define BLEN_KEYPAD_F1 2 + #define BLEN_KEYPAD_DOWN 3 + #define BLEN_KEYPAD_RIGHT 4 + #define BLEN_KEYPAD_MIDDLE 5 + #define BLEN_KEYPAD_UP 6 + #define BLEN_KEYPAD_LEFT 7 + + #define EN_KEYPAD_F1 _BV(BTN_OFFSET + BLEN_KEYPAD_F1) + #define EN_KEYPAD_F2 _BV(BTN_OFFSET + BLEN_KEYPAD_F2) + #define EN_KEYPAD_F3 _BV(BTN_OFFSET + BLEN_KEYPAD_F3) + #define EN_KEYPAD_DOWN _BV(BTN_OFFSET + BLEN_KEYPAD_DOWN) + #define EN_KEYPAD_RIGHT _BV(BTN_OFFSET + BLEN_KEYPAD_RIGHT) + #define EN_KEYPAD_MIDDLE _BV(BTN_OFFSET + BLEN_KEYPAD_MIDDLE) + #define EN_KEYPAD_UP _BV(BTN_OFFSET + BLEN_KEYPAD_UP) + #define EN_KEYPAD_LEFT _BV(BTN_OFFSET + BLEN_KEYPAD_LEFT) + + #define RRK(B) (keypad_buttons & (B)) + + #ifdef EN_C + #define BUTTON_CLICK() ((buttons & EN_C) || RRK(EN_KEYPAD_MIDDLE)) + #else + #define BUTTON_CLICK() RRK(EN_KEYPAD_MIDDLE) #endif #endif diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin.cpp b/Marlin/src/lcd/e3v2/enhanced/dwin.cpp index 64a85b4b2311..4e730d04e727 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin.cpp +++ b/Marlin/src/lcd/e3v2/enhanced/dwin.cpp @@ -216,7 +216,7 @@ static bool sdprint = false; // New menu system pointers MenuClass *PrepareMenu = nullptr; -MenuClass *LevBedMenu = nullptr; +MenuClass *TrammingMenu = nullptr; MenuClass *MoveMenu = nullptr; MenuClass *ControlMenu = nullptr; MenuClass *AdvancedSettings = nullptr; @@ -1703,8 +1703,8 @@ void HMI_SaveProcessID(const uint8_t id) { void DWIN_StartHoming() { HMI_flag.home_flag = true; HMI_SaveProcessID(Homing); - Title.ShowCaption(F("Axis Homing")); - DWIN_Draw_Popup(ICON_BLTouch, F("Axis Homing"), F("Please wait until done.")); + Title.ShowCaption(GET_TEXT_F(MSG_LEVEL_BED_HOMING)); + DWIN_Draw_Popup(ICON_BLTouch, GET_TEXT_F(MSG_LEVEL_BED_HOMING), F("Please wait until done.")); } void DWIN_CompletedHoming() { @@ -1719,7 +1719,7 @@ void DWIN_CompletedHoming() { void DWIN_MeshLevelingStart() { #if HAS_ONESTEP_LEVELING HMI_SaveProcessID(Leveling); - Title.ShowCaption(F("Bed Leveling")); + Title.ShowCaption(GET_TEXT_F(MSG_BED_LEVELING)); DWIN_Draw_Popup(ICON_AutoLeveling, GET_TEXT_F(MSG_BED_LEVELING), F("Please wait until done.")); #elif ENABLED(MESH_BED_LEVELING) Draw_ManualMesh_Menu(); @@ -2403,18 +2403,16 @@ void SetSpeed() { SetPIntOnClick(MIN_PRINT_SPEED, MAX_PRINT_SPEED); } void ApplyFlow() { planner.refresh_e_factor(0); } void SetFlow() { SetPIntOnClick(MIN_PRINT_FLOW, MAX_PRINT_FLOW, ApplyFlow); } -// Leveling Bed Corners -void LevBed(uint8_t point) { +// Bed Tramming +void Tram(uint8_t point) { char cmd[100] = ""; #if HAS_ONESTEP_LEVELING static bool inLev = false; if (inLev) return; char str_1[6] = "", str_2[6] = "", str_3[6] = ""; - #define fmt "X:%s, Y:%s, Z:%s" float xpos = 0, ypos = 0, zval = 0; float margin = PROBING_MARGIN; #else - #define fmt "M420S0\nG28O\nG90\nG0Z5F300\nG0X%iY%iF5000\nG0Z0F300" int16_t xpos = 0, ypos = 0; int16_t margin = 30; #endif @@ -2449,7 +2447,7 @@ void LevBed(uint8_t point) { planner.synchronize(); inLev = true; zval = probe.probe_at_point(xpos, ypos, PROBE_PT_STOW); - sprintf_P(cmd, PSTR(fmt), + sprintf_P(cmd, PSTR("X:%s, Y:%s, Z:%s"), dtostrf(xpos, 1, 1, str_1), dtostrf(ypos, 1, 1, str_2), dtostrf(zval, 1, 2, str_3) @@ -2458,16 +2456,16 @@ void LevBed(uint8_t point) { inLev = false; #else planner.synchronize(); - sprintf_P(cmd, PSTR(fmt), xpos, ypos); + sprintf_P(cmd, PSTR("M420S0\nG28O\nG90\nG0Z5F300\nG0X%iY%iF5000\nG0Z0F300"), xpos, ypos); queue.inject(cmd); #endif } -void LevBedFL() { LevBed(0); } -void LevBedFR() { LevBed(1); } -void LevBedBR() { LevBed(2); } -void LevBedBL() { LevBed(3); } -void LevBedC () { LevBed(4); } +void TramFL() { Tram(0); } +void TramFR() { Tram(1); } +void TramBR() { Tram(2); } +void TramBL() { Tram(3); } +void TramC () { Tram(4); } #if ENABLED(MESH_BED_LEVELING) @@ -3184,7 +3182,7 @@ void Draw_Prepare_Menu() { ADDMENUITEM(ICON_FilMan, GET_TEXT_F(MSG_FILAMENT_MAN), onDrawSubMenu, Draw_FilamentMan_Menu); #endif ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_MOVE_AXIS), onDrawMoveSubMenu, Goto_Move_Menu); - ADDMENUITEM(ICON_LevBed, GET_TEXT_F(MSG_BED_LEVELING), onDrawSubMenu, Draw_LevBedCorners_Menu); + ADDMENUITEM(ICON_Tram, GET_TEXT_F(MSG_BED_TRAMMING), onDrawSubMenu, Draw_Tramming_Menu); ADDMENUITEM(ICON_CloseMotor, GET_TEXT_F(MSG_DISABLE_STEPPERS), onDrawDisableMotors, DisableMotors); #if ENABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU) ADDMENUITEM(ICON_Homing, GET_TEXT_F(MSG_HOMING), onDrawSubMenu, Draw_Homing_Menu); @@ -3218,20 +3216,20 @@ void Draw_Prepare_Menu() { CurrentMenu->draw(); } -void Draw_LevBedCorners_Menu() { +void Draw_Tramming_Menu() { DWINUI::ClearMenuArea(); checkkey = Menu; - if (!LevBedMenu) LevBedMenu = new MenuClass(); - if (CurrentMenu != LevBedMenu) { - CurrentMenu = LevBedMenu; + if (!TrammingMenu) TrammingMenu = new MenuClass(); + if (CurrentMenu != TrammingMenu) { + CurrentMenu = TrammingMenu; SetMenuTitle({0}, GET_TEXT_F(MSG_BED_TRAMMING)); // TODO: Chinese, English "Bed Tramming" JPG DWINUI::MenuItemsPrepare(6); ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Prepare_Menu); - ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_FL), onDrawMenuItem, LevBedFL); - ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_FR), onDrawMenuItem, LevBedFR); - ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_BR), onDrawMenuItem, LevBedBR); - ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_BL), onDrawMenuItem, LevBedBL); - ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_C ), onDrawMenuItem, LevBedC ); + ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_FL), onDrawMenuItem, TramFL); + ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_FR), onDrawMenuItem, TramFR); + ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_BR), onDrawMenuItem, TramBR); + ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_BL), onDrawMenuItem, TramBL); + ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_C ), onDrawMenuItem, TramC ); } CurrentMenu->draw(); } @@ -3628,7 +3626,7 @@ void Draw_MaxSpeed_Menu() { ADDMENUITEM_P(ICON_MaxSpeedY, GET_TEXT_F(MSG_MAXSPEED_Y), onDrawMaxSpeedY, SetMaxSpeedY, &planner.settings.max_feedrate_mm_s[Y_AXIS]); ADDMENUITEM_P(ICON_MaxSpeedZ, GET_TEXT_F(MSG_MAXSPEED_Z), onDrawMaxSpeedZ, SetMaxSpeedZ, &planner.settings.max_feedrate_mm_s[Z_AXIS]); #if HAS_HOTEND - ADDMENUITEM_P(ICON_MaxSpeedE, GET_TEXT_F(MSG_MAXSPEED_E), onDrawMaxSpeedE, SetMaxSpeedE, &planner.settings.max_feedrate_mm_s[Z_AXIS]); + ADDMENUITEM_P(ICON_MaxSpeedE, GET_TEXT_F(MSG_MAXSPEED_E), onDrawMaxSpeedE, SetMaxSpeedE, &planner.settings.max_feedrate_mm_s[E_AXIS]); #endif } CurrentMenu->draw(); diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin.h b/Marlin/src/lcd/e3v2/enhanced/dwin.h index 773c9c7bdfaf..f377732b4139 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin.h +++ b/Marlin/src/lcd/e3v2/enhanced/dwin.h @@ -211,7 +211,7 @@ void Draw_Control_Menu(); void Draw_AdvancedSettings_Menu(); void Draw_Prepare_Menu(); void Draw_Move_Menu(); -void Draw_LevBedCorners_Menu(); +void Draw_Tramming_Menu(); #if HAS_HOME_OFFSET void Draw_HomeOffset_Menu(); #endif diff --git a/Marlin/src/lcd/e3v2/enhanced/dwinui.h b/Marlin/src/lcd/e3v2/enhanced/dwinui.h index c222b3aeb92a..c92014e84ffc 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwinui.h +++ b/Marlin/src/lcd/e3v2/enhanced/dwinui.h @@ -52,7 +52,7 @@ #define ICON_HomeX ICON_MoveX #define ICON_HomeY ICON_MoveY #define ICON_HomeZ ICON_MoveZ -#define ICON_LevBed ICON_SetEndTemp +#define ICON_Tram ICON_SetEndTemp #define ICON_Lock ICON_Cool #define ICON_ManualMesh ICON_HotendTemp #define ICON_MeshNext ICON_Axis diff --git a/Marlin/src/lcd/e3v2/enhanced/lockscreen.h b/Marlin/src/lcd/e3v2/enhanced/lockscreen.h index f44ca418f1b6..a51c82f34e5c 100644 --- a/Marlin/src/lcd/e3v2/enhanced/lockscreen.h +++ b/Marlin/src/lcd/e3v2/enhanced/lockscreen.h @@ -40,7 +40,7 @@ class LockScreenClass { static void init(); static void onEncoder(EncoderState encoder_diffState); static void draw(); - static inline bool isUnlocked() { return unlocked; } + static bool isUnlocked() { return unlocked; } }; extern LockScreenClass lockScreen; diff --git a/Marlin/src/lcd/e3v2/marlinui/dwin_string.h b/Marlin/src/lcd/e3v2/marlinui/dwin_string.h index 30af387bdcba..64676dddfdaf 100644 --- a/Marlin/src/lcd/e3v2/marlinui/dwin_string.h +++ b/Marlin/src/lcd/e3v2/marlinui/dwin_string.h @@ -55,7 +55,7 @@ class DWIN_String { //static font_t *font() { return font_header; }; //static uint16_t font_height() { return font_header->FontAscent - font_header->FontDescent; } //static glyph_t *glyph(uint8_t character) { return glyphs[character] ?: glyphs[0x3F]; } /* Use '?' for unknown glyphs */ - //static inline glyph_t *glyph(uint8_t *character) { return glyph(*character); } + //static glyph_t *glyph(uint8_t *character) { return glyph(*character); } static void set(); //static void add(uint8_t character) { add_character(character); eol(); } @@ -65,10 +65,10 @@ class DWIN_String { static void set(uint8_t *string) { set(); add(string); } static void set(wchar_t character) { set(); add(character); } static void set(uint8_t *string, int8_t index, const char *itemString=nullptr) { set(); add(string, index, (uint8_t *)itemString); } - static inline void set(FSTR_P fstring) { set((uint8_t *)fstring); } - static inline void set(const char *string) { set((uint8_t *)string); } - static inline void set(const char *string, int8_t index, const char *itemString=nullptr) { set((uint8_t *)string, index, itemString); } - static inline void add(const char *string) { add((uint8_t *)string); } + static void set(FSTR_P fstring) { set((uint8_t *)fstring); } + static void set(const char *string) { set((uint8_t *)string); } + static void set(const char *string, int8_t index, const char *itemString=nullptr) { set((uint8_t *)string, index, itemString); } + static void add(const char *string) { add((uint8_t *)string); } static void trim(const uint8_t character=0x20); static void rtrim(const uint8_t character=0x20); @@ -76,9 +76,9 @@ class DWIN_String { static void truncate(uint8_t maxlen) { if (len > maxlen) { len = maxlen; eol(); } } - static inline uint8_t length() { return len; } - static inline uint16_t width() { return span; } - static inline uint8_t *string() { return data; } + static uint8_t length() { return len; } + static uint16_t width() { return span; } + static uint8_t *string() { return data; } static uint16_t center(uint16_t width) { return span > width ? 0 : (width - span) / 2; } }; diff --git a/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp b/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp index 6db5972fa70f..c56d8aa7fbb3 100644 --- a/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp +++ b/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp @@ -366,7 +366,7 @@ int8_t ChironTFT::FindToken(char c) { #endif return pos; } - } while(++pos < command_len); + } while (++pos < command_len); #if ACDEBUG(AC_INFO) SERIAL_ECHOLNPGM("Not found: ", c); #endif diff --git a/Marlin/src/lcd/extui/dgus/DGUSDisplay.h b/Marlin/src/lcd/extui/dgus/DGUSDisplay.h index e486a0014570..3040225d071a 100644 --- a/Marlin/src/lcd/extui/dgus/DGUSDisplay.h +++ b/Marlin/src/lcd/extui/dgus/DGUSDisplay.h @@ -95,14 +95,14 @@ class DGUSDisplay { // Checks two things: Can we confirm the presence of the display and has we initialized it. // (both boils down that the display answered to our chatting) - static inline bool isInitialized() { return Initialized; } + static bool isInitialized() { return Initialized; } private: static void WriteHeader(uint16_t adr, uint8_t cmd, uint8_t payloadlen); static void WritePGM(const char str[], uint8_t len); static void ProcessRx(); - static inline uint16_t swap16(const uint16_t value) { return (value & 0xFFU) << 8U | (value >> 8U); } + static uint16_t swap16(const uint16_t value) { return (value & 0xFFU) << 8U | (value >> 8U); } static rx_datagram_state_t rx_datagram_state; static uint8_t rx_datagram_len; static bool Initialized, no_reentrance; diff --git a/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp index 2b00fd16f8e2..70bcca185960 100644 --- a/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp @@ -508,9 +508,9 @@ void DGUSScreenHandler::HandleStepPerMMChanged(DGUS_VP_Variable &var, void *val_ case VP_Z_STEP_PER_MM: axis = ExtUI::axis_t::Z; break; default: return; } - DEBUG_ECHOLNPAIR_F("value:", value); + DEBUG_ECHOLNPGM("value:", value); ExtUI::setAxisSteps_per_mm(value, axis); - DEBUG_ECHOLNPAIR_F("value_set:", ExtUI::getAxisSteps_per_mm(axis)); + DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisSteps_per_mm(axis)); skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel return; } @@ -531,9 +531,9 @@ void DGUSScreenHandler::HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, vo #endif #endif } - DEBUG_ECHOLNPAIR_F("value:", value); + DEBUG_ECHOLNPGM("value:", value); ExtUI::setAxisSteps_per_mm(value, extruder); - DEBUG_ECHOLNPAIR_F("value_set:", ExtUI::getAxisSteps_per_mm(extruder)); + DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisSteps_per_mm(extruder)); skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } diff --git a/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp index 750acece1c06..eba4b153f135 100644 --- a/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp @@ -268,7 +268,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { #endif } - DEBUG_ECHOLNPAIR_F("V3:", newvalue); + DEBUG_ECHOLNPGM("V3:", newvalue); *(float *)var.memadr = newvalue; skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel diff --git a/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.h index bb0bd2bd3b42..dfc1e9ea7d68 100644 --- a/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.h @@ -38,10 +38,10 @@ class DGUSScreenHandler { // Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen // The bools specifying whether the strings are in RAM or FLASH. static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); - static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { + static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { sendinfoscreen(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash); } - static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { + static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { sendinfoscreen(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash); } @@ -206,20 +206,20 @@ class DGUSScreenHandler { static void DGUSLCD_SendFloatAsIntValueToDisplay(DGUS_VP_Variable &var) { if (var.memadr) { float f = *(float *)var.memadr; - DEBUG_ECHOLNPAIR_F(" >> ", f, 6); + DEBUG_ECHOLNPGM(" >> ", f, 6); f *= cpow(10, decimals); dgusdisplay.WriteVariable(var.VP, (int16_t)f); } } // Force an update of all VP on the current screen. - static inline void ForceCompleteUpdate() { update_ptr = 0; ScreenComplete = false; } + static void ForceCompleteUpdate() { update_ptr = 0; ScreenComplete = false; } // Has all VPs sent to the screen - static inline bool IsScreenComplete() { return ScreenComplete; } + static bool IsScreenComplete() { return ScreenComplete; } - static inline DGUSLCD_Screens getCurrentScreen() { return current_screen; } + static DGUSLCD_Screens getCurrentScreen() { return current_screen; } - static inline void SetupConfirmAction( void (*f)()) { confirm_action_cb = f; } + static void SetupConfirmAction( void (*f)()) { confirm_action_cb = f; } private: static DGUSLCD_Screens current_screen; //< currently on screen diff --git a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp index 79a3cb91038d..88b3255b66e2 100644 --- a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp @@ -268,7 +268,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { #endif } - DEBUG_ECHOLNPAIR_F("V3:", newvalue); + DEBUG_ECHOLNPGM("V3:", newvalue); *(float *)var.memadr = newvalue; skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel diff --git a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.h index bb0bd2bd3b42..dfc1e9ea7d68 100644 --- a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.h @@ -38,10 +38,10 @@ class DGUSScreenHandler { // Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen // The bools specifying whether the strings are in RAM or FLASH. static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); - static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { + static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { sendinfoscreen(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash); } - static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { + static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { sendinfoscreen(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash); } @@ -206,20 +206,20 @@ class DGUSScreenHandler { static void DGUSLCD_SendFloatAsIntValueToDisplay(DGUS_VP_Variable &var) { if (var.memadr) { float f = *(float *)var.memadr; - DEBUG_ECHOLNPAIR_F(" >> ", f, 6); + DEBUG_ECHOLNPGM(" >> ", f, 6); f *= cpow(10, decimals); dgusdisplay.WriteVariable(var.VP, (int16_t)f); } } // Force an update of all VP on the current screen. - static inline void ForceCompleteUpdate() { update_ptr = 0; ScreenComplete = false; } + static void ForceCompleteUpdate() { update_ptr = 0; ScreenComplete = false; } // Has all VPs sent to the screen - static inline bool IsScreenComplete() { return ScreenComplete; } + static bool IsScreenComplete() { return ScreenComplete; } - static inline DGUSLCD_Screens getCurrentScreen() { return current_screen; } + static DGUSLCD_Screens getCurrentScreen() { return current_screen; } - static inline void SetupConfirmAction( void (*f)()) { confirm_action_cb = f; } + static void SetupConfirmAction( void (*f)()) { confirm_action_cb = f; } private: static DGUSLCD_Screens current_screen; //< currently on screen diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp index 0e2a971fd1b8..8054181353ec 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp @@ -93,7 +93,7 @@ void DGUSScreenHandler::DGUSLCD_SendFanToDisplay(DGUS_VP_Variable &var) { void DGUSScreenHandler::DGUSLCD_SendBabyStepToDisplay_MKS(DGUS_VP_Variable &var) { float value = current_position.z; - DEBUG_ECHOLNPAIR_F(" >> ", value, 6); + DEBUG_ECHOLNPGM(" >> ", value, 6); value *= cpow(10, 2); dgusdisplay.WriteVariable(VP_SD_Print_Baby, (uint16_t)value); } @@ -399,7 +399,7 @@ void DGUSScreenHandler::GetOffsetValue(DGUS_VP_Variable &var, void *val_ptr) { #if HAS_BED_PROBE int32_t value = swap32(*(int32_t *)val_ptr); float Offset = value / 100.0f; - DEBUG_ECHOLNPAIR_F("\nget int6 offset >> ", value, 6); + DEBUG_ECHOLNPGM("\nget int6 offset >> ", value, 6); #endif switch (var.VP) { @@ -909,7 +909,7 @@ void DGUSScreenHandler::HandleChangeLevelPoint_MKS(DGUS_VP_Variable &var, void * DEBUG_ECHOLNPGM("HandleChangeLevelPoint_MKS"); const int16_t value_raw = swap16(*(int16_t*)val_ptr); - DEBUG_ECHOLNPAIR_F("value_raw:", value_raw); + DEBUG_ECHOLNPGM("value_raw:", value_raw); *(int16_t*)var.memadr = value_raw; @@ -924,7 +924,7 @@ void DGUSScreenHandler::HandleStepPerMMChanged_MKS(DGUS_VP_Variable &var, void * const float value = (float)value_raw; DEBUG_ECHOLNPGM("value_raw:", value_raw); - DEBUG_ECHOLNPAIR_F("value:", value); + DEBUG_ECHOLNPGM("value:", value); ExtUI::axis_t axis; switch (var.VP) { @@ -934,7 +934,7 @@ void DGUSScreenHandler::HandleStepPerMMChanged_MKS(DGUS_VP_Variable &var, void * case VP_Z_STEP_PER_MM: axis = ExtUI::axis_t::Z; break; } ExtUI::setAxisSteps_per_mm(value, axis); - DEBUG_ECHOLNPAIR_F("value_set:", ExtUI::getAxisSteps_per_mm(axis)); + DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisSteps_per_mm(axis)); settings.save(); skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } @@ -946,7 +946,7 @@ void DGUSScreenHandler::HandleStepPerMMExtruderChanged_MKS(DGUS_VP_Variable &var const float value = (float)value_raw; DEBUG_ECHOLNPGM("value_raw:", value_raw); - DEBUG_ECHOLNPAIR_F("value:", value); + DEBUG_ECHOLNPGM("value:", value); ExtUI::extruder_t extruder; switch (var.VP) { @@ -959,7 +959,7 @@ void DGUSScreenHandler::HandleStepPerMMExtruderChanged_MKS(DGUS_VP_Variable &var #endif } ExtUI::setAxisSteps_per_mm(value, extruder); - DEBUG_ECHOLNPAIR_F("value_set:", ExtUI::getAxisSteps_per_mm(extruder)); + DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisSteps_per_mm(extruder)); settings.save(); skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } @@ -971,7 +971,7 @@ void DGUSScreenHandler::HandleMaxSpeedChange_MKS(DGUS_VP_Variable &var, void *va const float value = (float)value_raw; DEBUG_ECHOLNPGM("value_raw:", value_raw); - DEBUG_ECHOLNPAIR_F("value:", value); + DEBUG_ECHOLNPGM("value:", value); ExtUI::axis_t axis; switch (var.VP) { @@ -981,7 +981,7 @@ void DGUSScreenHandler::HandleMaxSpeedChange_MKS(DGUS_VP_Variable &var, void *va default: return; } ExtUI::setAxisMaxFeedrate_mm_s(value, axis); - DEBUG_ECHOLNPAIR_F("value_set:", ExtUI::getAxisMaxFeedrate_mm_s(axis)); + DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisMaxFeedrate_mm_s(axis)); settings.save(); skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } @@ -993,7 +993,7 @@ void DGUSScreenHandler::HandleExtruderMaxSpeedChange_MKS(DGUS_VP_Variable &var, const float value = (float)value_raw; DEBUG_ECHOLNPGM("value_raw:", value_raw); - DEBUG_ECHOLNPAIR_F("value:", value); + DEBUG_ECHOLNPGM("value:", value); ExtUI::extruder_t extruder; switch (var.VP) { @@ -1006,7 +1006,7 @@ void DGUSScreenHandler::HandleExtruderMaxSpeedChange_MKS(DGUS_VP_Variable &var, case VP_E1_MAX_SPEED: extruder = ExtUI::extruder_t::E1; break; } ExtUI::setAxisMaxFeedrate_mm_s(value, extruder); - DEBUG_ECHOLNPAIR_F("value_set:", ExtUI::getAxisMaxFeedrate_mm_s(extruder)); + DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisMaxFeedrate_mm_s(extruder)); settings.save(); skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } @@ -1018,7 +1018,7 @@ void DGUSScreenHandler::HandleMaxAccChange_MKS(DGUS_VP_Variable &var, void *val_ const float value = (float)value_raw; DEBUG_ECHOLNPGM("value_raw:", value_raw); - DEBUG_ECHOLNPAIR_F("value:", value); + DEBUG_ECHOLNPGM("value:", value); ExtUI::axis_t axis; switch (var.VP) { @@ -1028,7 +1028,7 @@ void DGUSScreenHandler::HandleMaxAccChange_MKS(DGUS_VP_Variable &var, void *val_ case VP_Z_ACC_MAX_SPEED: axis = ExtUI::axis_t::Z; break; } ExtUI::setAxisMaxAcceleration_mm_s2(value, axis); - DEBUG_ECHOLNPAIR_F("value_set:", ExtUI::getAxisMaxAcceleration_mm_s2(axis)); + DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisMaxAcceleration_mm_s2(axis)); settings.save(); skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } @@ -1049,9 +1049,9 @@ void DGUSScreenHandler::HandleExtruderAccChange_MKS(DGUS_VP_Variable &var, void case VP_E1_ACC_MAX_SPEED: extruder = ExtUI::extruder_t::E1; settings.load(); break; #endif } - DEBUG_ECHOLNPAIR_F("value:", value); + DEBUG_ECHOLNPGM("value:", value); ExtUI::setAxisMaxAcceleration_mm_s2(value, extruder); - DEBUG_ECHOLNPAIR_F("value_set:", ExtUI::getAxisMaxAcceleration_mm_s2(extruder)); + DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisMaxAcceleration_mm_s2(extruder)); settings.save(); skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } @@ -1115,7 +1115,7 @@ void DGUSScreenHandler::HandleAccChange_MKS(DGUS_VP_Variable &var, void *val_ptr #endif } - DEBUG_ECHOLNPAIR_F("V3:", newvalue); + DEBUG_ECHOLNPGM("V3:", newvalue); *(float *)var.memadr = newvalue; settings.save(); @@ -1175,7 +1175,7 @@ void DGUSScreenHandler::GetManualFilament(DGUS_VP_Variable &var, void *val_ptr) float value = (float)value_len; - DEBUG_ECHOLNPAIR_F("Get Filament len value:", value); + DEBUG_ECHOLNPGM("Get Filament len value:", value); distanceFilament = value; skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel @@ -1186,7 +1186,7 @@ void DGUSScreenHandler::GetManualFilamentSpeed(DGUS_VP_Variable &var, void *val_ uint16_t value_len = swap16(*(uint16_t*)val_ptr); - DEBUG_ECHOLNPAIR_F("filamentSpeed_mm_s value:", value_len); + DEBUG_ECHOLNPGM("filamentSpeed_mm_s value:", value_len); filamentSpeed_mm_s = value_len; diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h index 0c80cd260ef9..ee423b7bb943 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h @@ -38,10 +38,10 @@ class DGUSScreenHandler { // Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen // The bools specifying whether the strings are in RAM or FLASH. static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); - static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { + static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { sendinfoscreen(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash); } - static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { + static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { sendinfoscreen(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash); } @@ -273,20 +273,20 @@ class DGUSScreenHandler { static void DGUSLCD_SendFloatAsIntValueToDisplay(DGUS_VP_Variable &var) { if (var.memadr) { float f = *(float *)var.memadr; - DEBUG_ECHOLNPAIR_F(" >> ", f, 6); + DEBUG_ECHOLNPGM(" >> ", f, 6); f *= cpow(10, decimals); dgusdisplay.WriteVariable(var.VP, (int16_t)f); } } // Force an update of all VP on the current screen. - static inline void ForceCompleteUpdate() { update_ptr = 0; ScreenComplete = false; } + static void ForceCompleteUpdate() { update_ptr = 0; ScreenComplete = false; } // Has all VPs sent to the screen - static inline bool IsScreenComplete() { return ScreenComplete; } + static bool IsScreenComplete() { return ScreenComplete; } - static inline DGUSLCD_Screens getCurrentScreen() { return current_screen; } + static DGUSLCD_Screens getCurrentScreen() { return current_screen; } - static inline void SetupConfirmAction( void (*f)()) { confirm_action_cb = f; } + static void SetupConfirmAction( void (*f)()) { confirm_action_cb = f; } private: static DGUSLCD_Screens current_screen; //< currently on screen diff --git a/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.cpp index b77c92b7eb95..fb08fbf84919 100644 --- a/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.cpp @@ -268,7 +268,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { #endif } - DEBUG_ECHOLNPAIR_F("V3:", newvalue); + DEBUG_ECHOLNPGM("V3:", newvalue); *(float *)var.memadr = newvalue; skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel diff --git a/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.h index bb0bd2bd3b42..dfc1e9ea7d68 100644 --- a/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.h @@ -38,10 +38,10 @@ class DGUSScreenHandler { // Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen // The bools specifying whether the strings are in RAM or FLASH. static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); - static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { + static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { sendinfoscreen(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash); } - static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { + static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { sendinfoscreen(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash); } @@ -206,20 +206,20 @@ class DGUSScreenHandler { static void DGUSLCD_SendFloatAsIntValueToDisplay(DGUS_VP_Variable &var) { if (var.memadr) { float f = *(float *)var.memadr; - DEBUG_ECHOLNPAIR_F(" >> ", f, 6); + DEBUG_ECHOLNPGM(" >> ", f, 6); f *= cpow(10, decimals); dgusdisplay.WriteVariable(var.VP, (int16_t)f); } } // Force an update of all VP on the current screen. - static inline void ForceCompleteUpdate() { update_ptr = 0; ScreenComplete = false; } + static void ForceCompleteUpdate() { update_ptr = 0; ScreenComplete = false; } // Has all VPs sent to the screen - static inline bool IsScreenComplete() { return ScreenComplete; } + static bool IsScreenComplete() { return ScreenComplete; } - static inline DGUSLCD_Screens getCurrentScreen() { return current_screen; } + static DGUSLCD_Screens getCurrentScreen() { return current_screen; } - static inline void SetupConfirmAction( void (*f)()) { confirm_action_cb = f; } + static void SetupConfirmAction( void (*f)()) { confirm_action_cb = f; } private: static DGUSLCD_Screens current_screen; //< currently on screen diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.h b/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.h index 265e2fe584bd..332108d81a30 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.h @@ -98,7 +98,7 @@ class DGUSDisplay { // Checks two things: Can we confirm the presence of the display and has we initialized it. // (both boils down that the display answered to our chatting) - static inline bool IsInitialized() { + static bool IsInitialized() { return initialized; } diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/compat.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/compat.h index 3b63b0fd5be6..afb380aa90ad 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/compat.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/compat.h @@ -43,8 +43,8 @@ #define min(a,b) ((a)<(b)?(a):(b)) #else namespace UI { - static inline uint32_t safe_millis() { return millis(); } - static inline void yield() {} + static uint32_t safe_millis() { return millis(); } + static void yield() {} }; #endif diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h index b8e687147ba9..da911c772daa 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h @@ -40,13 +40,13 @@ template struct port_pin { typedef port_t port; - static inline void set_high() {port::port() = (port::port() | bits);} - static inline void set_low() {port::port() = (port::port() & (~bits));} - static inline void set_input() {port::ddr() = (port::ddr() & (~bits));} - static inline void set_input_pullup() {set_input(); set_high();} - static inline void set_output() {port::ddr() = (port::ddr() | bits);} - static inline uint8_t read() {return port::pin() & bits;} - static inline void write(bool v) {if (v) set_high(); else set_low();} + static void set_high() {port::port() = (port::port() | bits);} + static void set_low() {port::port() = (port::port() & (~bits));} + static void set_input() {port::ddr() = (port::ddr() & (~bits));} + static void set_input_pullup() {set_input(); set_high();} + static void set_output() {port::ddr() = (port::ddr() | bits);} + static uint8_t read() {return port::pin() & bits;} + static void write(bool v) {if (v) set_high(); else set_low();} }; #define MAKE_AVR_PORT_PINS(ID) \ @@ -109,13 +109,13 @@ template struct arduino_digital_pin { static constexpr uint8_t pin = p; - static inline void set_high() {digitalWrite(p, HIGH);} - static inline void set_low() {digitalWrite(p, LOW);} - static inline void set_input() {pinMode(p, INPUT);} - static inline void set_input_pullup() {pinMode(p, INPUT_PULLUP);} - static inline void set_output() {pinMode(p, OUTPUT);} - static inline uint8_t read() {return digitalRead(p);} - static inline void write(bool v) {digitalWrite(p, v ? HIGH : LOW);} + static void set_high() {digitalWrite(p, HIGH);} + static void set_low() {digitalWrite(p, LOW);} + static void set_input() {pinMode(p, INPUT);} + static void set_input_pullup() {pinMode(p, INPUT_PULLUP);} + static void set_output() {pinMode(p, OUTPUT);} + static uint8_t read() {return digitalRead(p);} + static void write(bool v) {digitalWrite(p, v ? HIGH : LOW);} }; #define MAKE_ARDUINO_PINS(ID) typedef arduino_digital_pin ARDUINO_DIGITAL_##ID; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_list.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_list.h index 2ddab1b818b4..b204f04743a4 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_list.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_list.h @@ -29,10 +29,10 @@ class SoundList { } list[]; public: static const uint8_t n; - static inline const char* name(uint8_t val) { + static const char* name(uint8_t val) { return (const char* ) pgm_read_ptr_far(&list[val].name); } - static inline FTDI::SoundPlayer::sound_t* data(uint8_t val) { + static FTDI::SoundPlayer::sound_t* data(uint8_t val) { return (FTDI::SoundPlayer::sound_t*) pgm_read_ptr_far(&list[val].data); } }; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/files_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/files_screen.cpp index 5076e58adf6e..6f428fa17487 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/files_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/files_screen.cpp @@ -77,7 +77,7 @@ const char *FilesScreen::getSelectedFilename(bool shortName) { } void FilesScreen::drawSelectedFile() { - if(mydata.selected_tag == 0xFF) return; + if (mydata.selected_tag == 0xFF) return; FileList files; files.seek(getSelectedFileIndex(), true); mydata.flags.is_dir = files.isDir(); diff --git a/Marlin/src/lcd/extui/mks_ui/SPIFlashStorage.h b/Marlin/src/lcd/extui/mks_ui/SPIFlashStorage.h index 4683ff935187..72394286ac58 100644 --- a/Marlin/src/lcd/extui/mks_ui/SPIFlashStorage.h +++ b/Marlin/src/lcd/extui/mks_ui/SPIFlashStorage.h @@ -96,12 +96,12 @@ class SPIFlashStorage { static uint8_t m_pageData[SPI_FLASH_PageSize]; static uint32_t m_currentPage; static uint16_t m_pageDataUsed; - static inline uint16_t pageDataFree() { return SPI_FLASH_PageSize - m_pageDataUsed; } + static uint16_t pageDataFree() { return SPI_FLASH_PageSize - m_pageDataUsed; } static uint32_t m_startAddress; #if HAS_SPI_FLASH_COMPRESSION static uint8_t m_compressedData[SPI_FLASH_PageSize]; static uint16_t m_compressedDataUsed; - static inline uint16_t compressedDataFree() { return SPI_FLASH_PageSize - m_compressedDataUsed; } + static uint16_t compressedDataFree() { return SPI_FLASH_PageSize - m_compressedDataUsed; } #endif }; diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 7014040097c4..e9aa0a6da543 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -274,8 +274,8 @@ class MarlinUI { static bool detected(); static void init_lcd(); #else - static inline bool detected() { return true; } - static inline void init_lcd() {} + static bool detected() { return true; } + static void init_lcd() {} #endif #if HAS_PRINT_PROGRESS @@ -294,7 +294,7 @@ class MarlinUI { static void set_progress_done() { progress_override = (PROGRESS_MASK + 1U) + 100U * (PROGRESS_SCALE); } static void progress_reset() { if (progress_override & (PROGRESS_MASK + 1U)) set_progress(0); } #if ENABLED(SHOW_REMAINING_TIME) - static inline uint32_t _calculated_remaining_time() { + static uint32_t _calculated_remaining_time() { const duration_t elapsed = print_job_timer.duration(); const progress_t progress = _get_progress(); return progress ? elapsed.value * (100 * (PROGRESS_SCALE) - progress) / progress : 0; @@ -342,12 +342,12 @@ class MarlinUI { static bool has_status(); static void reset_status(const bool no_welcome=false); static void set_alert_status(FSTR_P const fstr); - static inline void reset_alert_level() { alert_level = 0; } + static void reset_alert_level() { alert_level = 0; } #else static constexpr bool has_status() { return false; } - static inline void reset_status(const bool=false) {} - static inline void set_alert_status(FSTR_P const) {} - static inline void reset_alert_level() {} + static void reset_status(const bool=false) {} + static void set_alert_status(FSTR_P const) {} + static void reset_alert_level() {} #endif static void set_status(const char * const cstr, const bool persist=false); @@ -360,7 +360,7 @@ class MarlinUI { static void draw_status_message(const bool blink); #endif #else - static inline void kill_screen(FSTR_P const, FSTR_P const) {} + static void kill_screen(FSTR_P const, FSTR_P const) {} #endif #if HAS_DISPLAY @@ -444,7 +444,7 @@ class MarlinUI { #if HAS_BUZZER static void completion_feedback(const bool good=true); #else - static inline void completion_feedback(const bool=true) { TERN_(HAS_TOUCH_SLEEP, wakeup_screen()); } + static void completion_feedback(const bool=true) { TERN_(HAS_TOUCH_SLEEP, wakeup_screen()); } #endif #if ENABLED(ADVANCED_PAUSE_FEATURE) @@ -479,9 +479,9 @@ class MarlinUI { #else // No LCD - static inline void init() {} - static inline void update() {} - static inline void return_to_status() {} + static void init() {} + static void update() {} + static void return_to_status() {} #endif @@ -500,17 +500,17 @@ class MarlinUI { static preheat_t material_preset[PREHEAT_COUNT]; static PGM_P get_preheat_label(const uint8_t m); static void apply_preheat(const uint8_t m, const uint8_t pmask, const uint8_t e=active_extruder); - static inline void preheat_set_fan(const uint8_t m) { TERN_(HAS_FAN, apply_preheat(m, PM_FAN)); } - static inline void preheat_hotend(const uint8_t m, const uint8_t e=active_extruder) { TERN_(HAS_HOTEND, apply_preheat(m, PM_HOTEND)); } - static inline void preheat_hotend_and_fan(const uint8_t m, const uint8_t e=active_extruder) { preheat_hotend(m, e); preheat_set_fan(m); } - static inline void preheat_bed(const uint8_t m) { TERN_(HAS_HEATED_BED, apply_preheat(m, PM_BED)); } - static inline void preheat_all(const uint8_t m) { apply_preheat(m, 0xFF); } + static void preheat_set_fan(const uint8_t m) { TERN_(HAS_FAN, apply_preheat(m, PM_FAN)); } + static void preheat_hotend(const uint8_t m, const uint8_t e=active_extruder) { TERN_(HAS_HOTEND, apply_preheat(m, PM_HOTEND)); } + static void preheat_hotend_and_fan(const uint8_t m, const uint8_t e=active_extruder) { preheat_hotend(m, e); preheat_set_fan(m); } + static void preheat_bed(const uint8_t m) { TERN_(HAS_HEATED_BED, apply_preheat(m, PM_BED)); } + static void preheat_all(const uint8_t m) { apply_preheat(m, 0xFF); } #endif #if SCREENS_CAN_TIME_OUT - static inline void reset_status_timeout(const millis_t ms) { return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; } + static void reset_status_timeout(const millis_t ms) { return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; } #else - static inline void reset_status_timeout(const millis_t) {} + static void reset_status_timeout(const millis_t) {} #endif #if HAS_LCD_MENU @@ -548,11 +548,11 @@ class MarlinUI { // goto_previous_screen and go_back may also be used as menu item callbacks static void _goto_previous_screen(TERN_(TURBO_BACK_MENU_ITEM, const bool is_back)); - static inline void goto_previous_screen() { _goto_previous_screen(TERN_(TURBO_BACK_MENU_ITEM, false)); } - static inline void go_back() { _goto_previous_screen(TERN_(TURBO_BACK_MENU_ITEM, true)); } + static void goto_previous_screen() { _goto_previous_screen(TERN_(TURBO_BACK_MENU_ITEM, false)); } + static void go_back() { _goto_previous_screen(TERN_(TURBO_BACK_MENU_ITEM, true)); } static void return_to_status(); - static inline bool on_status_screen() { return currentScreen == status_screen; } + static bool on_status_screen() { return currentScreen == status_screen; } FORCE_INLINE static void run_current_screen() { (*currentScreen)(); } #if ENABLED(LIGHTWEIGHT_UI) @@ -567,7 +567,7 @@ class MarlinUI { TERN(SCREENS_CAN_TIME_OUT, defer_return_to_status = defer, UNUSED(defer)); } - static inline void goto_previous_screen_no_defer() { + static void goto_previous_screen_no_defer() { defer_status_screen(false); goto_previous_screen(); } @@ -599,20 +599,20 @@ class MarlinUI { #if EITHER(HAS_LCD_MENU, EXTENSIBLE_UI) static bool lcd_clicked; - static inline bool use_click() { + static bool use_click() { const bool click = lcd_clicked; lcd_clicked = false; return click; } #else static constexpr bool lcd_clicked = false; - static inline bool use_click() { return false; } + static bool use_click() { return false; } #endif #if ENABLED(ADVANCED_PAUSE_FEATURE) && ANY(HAS_LCD_MENU, EXTENSIBLE_UI, DWIN_CREALITY_LCD_ENHANCED, DWIN_CREALITY_LCD_JYERSUI) static void pause_show_message(const PauseMessage message, const PauseMode mode=PAUSE_MODE_SAME, const uint8_t extruder=active_extruder); #else - static inline void _pause_show_message() {} + static void _pause_show_message() {} #define pause_show_message(...) _pause_show_message() #endif @@ -631,9 +631,9 @@ class MarlinUI { #endif #if DISABLED(EEPROM_AUTO_INIT) static void eeprom_alert(const uint8_t msgid); - static inline void eeprom_alert_crc() { eeprom_alert(0); } - static inline void eeprom_alert_index() { eeprom_alert(1); } - static inline void eeprom_alert_version() { eeprom_alert(2); } + static void eeprom_alert_crc() { eeprom_alert(0); } + static void eeprom_alert_index() { eeprom_alert(1); } + static void eeprom_alert_version() { eeprom_alert(2); } #endif #endif @@ -674,7 +674,7 @@ class MarlinUI { #endif static void update_buttons(); - static inline bool button_pressed() { return BUTTON_CLICK() || TERN(TOUCH_SCREEN, touch_pressed(), false); } + static bool button_pressed() { return BUTTON_CLICK() || TERN(TOUCH_SCREEN, touch_pressed(), false); } #if EITHER(AUTO_BED_LEVELING_UBL, G26_MESH_VALIDATION) static void wait_for_release(); #endif @@ -705,7 +705,7 @@ class MarlinUI { #else - static inline void update_buttons() {} + static void update_buttons() {} #endif diff --git a/Marlin/src/lcd/menu/menu.h b/Marlin/src/lcd/menu/menu.h index 048dab9b7315..72826262f456 100644 --- a/Marlin/src/lcd/menu/menu.h +++ b/Marlin/src/lcd/menu/menu.h @@ -109,7 +109,7 @@ class MenuItem_confirm : public MenuItemBase { selectFunc_t yesFunc, selectFunc_t noFunc, PGM_P const pref, const char * const string=nullptr, PGM_P const suff=nullptr ); - static inline void select_screen( + static void select_screen( PGM_P const yes, PGM_P const no, selectFunc_t yesFunc, selectFunc_t noFunc, PGM_P const pref, FSTR_P const string, PGM_P const suff=nullptr @@ -178,7 +178,7 @@ class MenuEditItemBase : public MenuItemBase { static void draw_edit_screen(PGM_P const pstr, const char * const value); // This method is for the current menu item - static inline void draw_edit_screen(const char * const value) { draw_edit_screen(editLabel, value); } + static void draw_edit_screen(const char * const value) { draw_edit_screen(editLabel, value); } }; #if ENABLED(SDSUPPORT) diff --git a/Marlin/src/lcd/menu/menu_item.h b/Marlin/src/lcd/menu/menu_item.h index 624b9b303d08..1834b56a8875 100644 --- a/Marlin/src/lcd/menu/menu_item.h +++ b/Marlin/src/lcd/menu/menu_item.h @@ -39,14 +39,14 @@ class MenuItem_submenu : public MenuItemBase { FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) { _draw(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0]); } - static inline void action(PGM_P const, const screenFunc_t func) { ui.push_current_screen(); ui.goto_screen(func); } + static void action(PGM_P const, const screenFunc_t func) { ui.push_current_screen(); ui.goto_screen(func); } }; // Any menu item that invokes an immediate action class MenuItem_button : public MenuItemBase { public: // Button-y Items are selectable lines with no other indicator - static inline void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) { + static void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) { _draw(sel, row, pstr, '>', ' '); } }; @@ -54,8 +54,8 @@ class MenuItem_button : public MenuItemBase { // ACTION_ITEM(LABEL, FUNC) class MenuItem_function : public MenuItem_button { public: - //static inline void action(PGM_P const, const uint8_t, const menuAction_t func) { (*func)(); }; - static inline void action(PGM_P const, const menuAction_t func) { if (func) (*func)(); }; + //static void action(PGM_P const, const uint8_t, const menuAction_t func) { (*func)(); }; + static void action(PGM_P const, const menuAction_t func) { if (func) (*func)(); }; }; // GCODES_ITEM(LABEL, GCODES) @@ -65,7 +65,7 @@ class MenuItem_gcode : public MenuItem_button { _draw(sel, row, pstr, '>', ' '); } static void action(PGM_P const, PGM_P const pgcode) { queue.inject(FPSTR(pgcode)); } - static inline void action(PGM_P const pstr, const uint8_t, PGM_P const pgcode) { action(pstr, pgcode); } + static void action(PGM_P const pstr, const uint8_t, PGM_P const pgcode) { action(pstr, pgcode); } }; //////////////////////////////////////////// @@ -77,8 +77,8 @@ template class TMenuEditItem : MenuEditItemBase { private: typedef typename NAME::type_t type_t; - static inline float scale(const_float_t value) { return NAME::scale(value); } - static inline float unscale(const_float_t value) { return NAME::unscale(value); } + static float scale(const_float_t value) { return NAME::scale(value); } + static float unscale(const_float_t value) { return NAME::unscale(value); } static const char* to_string(const int32_t value) { return NAME::strfunc(unscale(value)); } static void load(void *ptr, const int32_t value) { *((type_t*)ptr) = unscale(value); } public: @@ -117,9 +117,9 @@ class TMenuEditItem : MenuEditItemBase { * * struct MenuEditItemInfo_percent { * typedef uint8_t type_t; - * static inline float scale(const_float_t value) { return value * (100.f/255.f) +0.5f; } - * static inline float unscale(const_float_t value) { return value / (100.f/255.f) +0.5f; } - * static inline const char* strfunc(const_float_t value) { return ui8tostr4pctrj(_DOFIX(uint8_t,value)); } + * static float scale(const_float_t value) { return value * (100.f/255.f) +0.5f; } + * static float unscale(const_float_t value) { return value / (100.f/255.f) +0.5f; } + * static const char* strfunc(const_float_t value) { return ui8tostr4pctrj(_DOFIX(uint8_t,value)); } * }; * typedef TMenuEditItem MenuItem_percent */ @@ -128,9 +128,9 @@ class TMenuEditItem : MenuEditItemBase { #define DEFINE_MENU_EDIT_ITEM_TYPE(NAME, TYPE, STRFUNC, SCALE, ETC...) \ struct MenuEditItemInfo_##NAME { \ typedef TYPE type_t; \ - static inline float scale(const_float_t value) { return value * (SCALE) ETC; } \ - static inline float unscale(const_float_t value) { return value / (SCALE) ETC; } \ - static inline const char* strfunc(const_float_t value) { return STRFUNC(_DOFIX(TYPE,value)); } \ + static float scale(const_float_t value) { return value * (SCALE) ETC; } \ + static float unscale(const_float_t value) { return value / (SCALE) ETC; } \ + static const char* strfunc(const_float_t value) { return STRFUNC(_DOFIX(TYPE,value)); } \ }; \ typedef TMenuEditItem MenuItem_##NAME diff --git a/Marlin/src/lcd/tft/tft.h b/Marlin/src/lcd/tft/tft.h index 1576518b4bb7..435e7c30bf51 100644 --- a/Marlin/src/lcd/tft/tft.h +++ b/Marlin/src/lcd/tft/tft.h @@ -81,24 +81,24 @@ class TFT { static uint16_t buffer[TFT_BUFFER_SIZE]; static void init(); - static inline void set_font(const uint8_t *Font) { string.set_font(Font); } - static inline void add_glyphs(const uint8_t *Font) { string.add_glyphs(Font); } + static void set_font(const uint8_t *Font) { string.set_font(Font); } + static void add_glyphs(const uint8_t *Font) { string.add_glyphs(Font); } - static inline bool is_busy() { return io.isBusy(); } - static inline void abort() { io.Abort(); } - static inline void write_multiple(uint16_t Data, uint16_t Count) { io.WriteMultiple(Data, Count); } - static inline void write_sequence(uint16_t *Data, uint16_t Count) { io.WriteSequence(Data, Count); } - static inline void set_window(uint16_t Xmin, uint16_t Ymin, uint16_t Xmax, uint16_t Ymax) { io.set_window(Xmin, Ymin, Xmax, Ymax); } + static bool is_busy() { return io.isBusy(); } + static void abort() { io.Abort(); } + static void write_multiple(uint16_t Data, uint16_t Count) { io.WriteMultiple(Data, Count); } + static void write_sequence(uint16_t *Data, uint16_t Count) { io.WriteSequence(Data, Count); } + static void set_window(uint16_t Xmin, uint16_t Ymin, uint16_t Xmax, uint16_t Ymax) { io.set_window(Xmin, Ymin, Xmax, Ymax); } - static inline void fill(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color) { queue.fill(x, y, width, height, color); } - static inline void canvas(uint16_t x, uint16_t y, uint16_t width, uint16_t height) { queue.canvas(x, y, width, height); } - static inline void set_background(uint16_t color) { queue.set_background(color); } - static inline void add_text(uint16_t x, uint16_t y, uint16_t color, TFT_String tft_string, uint16_t maxWidth = 0) { queue.add_text(x, y, color, tft_string.string(), maxWidth); } - static inline void add_text(uint16_t x, uint16_t y, uint16_t color, const char *string, uint16_t maxWidth = 0) { queue.add_text(x, y, color, (uint8_t *)string, maxWidth); } - static inline void add_image(int16_t x, int16_t y, MarlinImage image, uint16_t *colors) { queue.add_image(x, y, image, colors); } - static inline void add_image(int16_t x, int16_t y, MarlinImage image, uint16_t color_main = COLOR_WHITE, uint16_t color_background = COLOR_BACKGROUND, uint16_t color_shadow = COLOR_BLACK) { queue.add_image(x, y, image, color_main, color_background, color_shadow); } - static inline void add_bar(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color) { queue.add_bar(x, y, width, height, color); } - static inline void add_rectangle(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color) { queue.add_rectangle(x, y, width, height, color); } + static void fill(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color) { queue.fill(x, y, width, height, color); } + static void canvas(uint16_t x, uint16_t y, uint16_t width, uint16_t height) { queue.canvas(x, y, width, height); } + static void set_background(uint16_t color) { queue.set_background(color); } + static void add_text(uint16_t x, uint16_t y, uint16_t color, TFT_String tft_string, uint16_t maxWidth = 0) { queue.add_text(x, y, color, tft_string.string(), maxWidth); } + static void add_text(uint16_t x, uint16_t y, uint16_t color, const char *string, uint16_t maxWidth = 0) { queue.add_text(x, y, color, (uint8_t *)string, maxWidth); } + static void add_image(int16_t x, int16_t y, MarlinImage image, uint16_t *colors) { queue.add_image(x, y, image, colors); } + static void add_image(int16_t x, int16_t y, MarlinImage image, uint16_t color_main = COLOR_WHITE, uint16_t color_background = COLOR_BACKGROUND, uint16_t color_shadow = COLOR_BLACK) { queue.add_image(x, y, image, color_main, color_background, color_shadow); } + static void add_bar(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color) { queue.add_bar(x, y, width, height, color); } + static void add_rectangle(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color) { queue.add_rectangle(x, y, width, height, color); } static void draw_edit_screen_buttons(); }; diff --git a/Marlin/src/lcd/tft/tft_string.h b/Marlin/src/lcd/tft/tft_string.h index 133889d9ae54..e486c2ee91c8 100644 --- a/Marlin/src/lcd/tft/tft_string.h +++ b/Marlin/src/lcd/tft/tft_string.h @@ -81,7 +81,7 @@ class TFT_String { static font_t *font() { return font_header; }; static uint16_t font_height() { return font_header->FontAscent - font_header->FontDescent; } static glyph_t *glyph(uint8_t character) { return glyphs[character] ?: glyphs[0x3F]; } /* Use '?' for unknown glyphs */ - static inline glyph_t *glyph(uint8_t *character) { return glyph(*character); } + static glyph_t *glyph(uint8_t *character) { return glyph(*character); } static void set(); static void add(uint8_t character) { add_character(character); eol(); } @@ -89,9 +89,9 @@ class TFT_String { static void add(uint8_t *string, int8_t index, uint8_t *itemString=nullptr); static void set(uint8_t *string) { set(); add(string); }; static void set(uint8_t *string, int8_t index, const char *itemString=nullptr) { set(); add(string, index, (uint8_t *)itemString); }; - static inline void set(const char *string) { set((uint8_t *)string); } - static inline void set(const char *string, int8_t index, const char *itemString=nullptr) { set((uint8_t *)string, index, itemString); } - static inline void add(const char *string) { add((uint8_t *)string); } + static void set(const char *string) { set((uint8_t *)string); } + static void set(const char *string, int8_t index, const char *itemString=nullptr) { set((uint8_t *)string, index, itemString); } + static void add(const char *string) { add((uint8_t *)string); } static void trim(uint8_t character=0x20); static void rtrim(uint8_t character=0x20); diff --git a/Marlin/src/lcd/tft/touch.h b/Marlin/src/lcd/tft/touch.h index 238453f765ed..6021a840b65e 100644 --- a/Marlin/src/lcd/tft/touch.h +++ b/Marlin/src/lcd/tft/touch.h @@ -106,7 +106,7 @@ class Touch { static millis_t last_touch_ms, time_to_hold, repeat_delay, touch_time; static TouchControlType touch_control_type; - static inline bool get_point(int16_t *x, int16_t *y); + static bool get_point(int16_t *x, int16_t *y); static void touch(touch_control_t *control); static void hold(touch_control_t *control, millis_t delay = 0); @@ -126,7 +126,7 @@ class Touch { static void enable() { enabled = true; } #if HAS_TOUCH_SLEEP static millis_t next_sleep_ms; - static inline bool isSleeping() { return next_sleep_ms == TSLP_SLEEPING; } + static bool isSleeping() { return next_sleep_ms == TSLP_SLEEPING; } static void sleepTimeout(); static void wakeUp(); #endif diff --git a/Marlin/src/libs/L64XX/L64XX_Marlin.h b/Marlin/src/libs/L64XX/L64XX_Marlin.h index e11d8e872e60..de7c0d605740 100644 --- a/Marlin/src/libs/L64XX/L64XX_Marlin.h +++ b/Marlin/src/libs/L64XX/L64XX_Marlin.h @@ -118,11 +118,11 @@ class L64XX_Marlin : public L64XXHelper { #if ENABLED(MONITOR_L6470_DRIVER_STATUS) static bool monitor_paused; - static inline void pause_monitor(const bool p) { monitor_paused = p; } + static void pause_monitor(const bool p) { monitor_paused = p; } static void monitor_update(L64XX_axis_t stepper_index); static void monitor_driver(); #else - static inline void pause_monitor(const bool) {} + static void pause_monitor(const bool) {} #endif //protected: diff --git a/Marlin/src/libs/buzzer.h b/Marlin/src/libs/buzzer.h index 21b69002ffd3..db5e3ee4ca79 100644 --- a/Marlin/src/libs/buzzer.h +++ b/Marlin/src/libs/buzzer.h @@ -77,7 +77,7 @@ * @brief Resets the state of the class * @details Brings the class state to a known one. */ - static inline void reset() { + static void reset() { off(); state.endtime = 0; } @@ -86,7 +86,7 @@ /** * @brief Init Buzzer */ - static inline void init() { + static void init() { SET_OUTPUT(BEEPER_PIN); reset(); } diff --git a/Marlin/src/libs/stopwatch.h b/Marlin/src/libs/stopwatch.h index fe5101a5beaa..829d510050d3 100644 --- a/Marlin/src/libs/stopwatch.h +++ b/Marlin/src/libs/stopwatch.h @@ -53,7 +53,7 @@ class Stopwatch { * @return true on success */ static bool stop(); - static inline bool abort() { return stop(); } // Alias by default + static bool abort() { return stop(); } // Alias by default /** * @brief Pause the stopwatch @@ -114,7 +114,7 @@ class Stopwatch { #else - static inline void debug(FSTR_P const) {} + static void debug(FSTR_P const) {} #endif }; diff --git a/Marlin/src/module/endstops.h b/Marlin/src/module/endstops.h index a35966a98c91..e1ee933e83ba 100644 --- a/Marlin/src/module/endstops.h +++ b/Marlin/src/module/endstops.h @@ -136,7 +136,7 @@ class Endstops { return enabled || TERN0(HAS_BED_PROBE, z_probe_enabled); } - static inline bool global_enabled() { return enabled_globally; } + static bool global_enabled() { return enabled_globally; } /** * Periodic call to poll endstops if required. Called from temperature ISR @@ -168,7 +168,7 @@ class Endstops { ; } - static inline bool probe_switch_activated() { + static bool probe_switch_activated() { return (true #if ENABLED(PROBE_ACTIVATION_SWITCH) && READ(PROBE_ACTIVATION_SWITCH_PIN) == PROBE_ACTIVATION_SWITCH_STATE diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index 69e3f035ba9d..380c35755c96 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -431,15 +431,15 @@ class Planner { static int8_t xy_freq_limit_hz; // Minimum XY frequency setting static float xy_freq_min_speed_factor; // Minimum speed factor setting static int32_t xy_freq_min_interval_us; // Minimum segment time based on xy_freq_limit_hz - static inline void refresh_frequency_limit() { + static void refresh_frequency_limit() { //xy_freq_min_interval_us = xy_freq_limit_hz ?: LROUND(1000000.0f / xy_freq_limit_hz); if (xy_freq_limit_hz) xy_freq_min_interval_us = LROUND(1000000.0f / xy_freq_limit_hz); } - static inline void set_min_speed_factor_u8(const uint8_t v255) { + static void set_min_speed_factor_u8(const uint8_t v255) { xy_freq_min_speed_factor = float(ui8_to_percent(v255)) / 100; } - static inline void set_frequency_limit(const uint8_t hz) { + static void set_frequency_limit(const uint8_t hz) { xy_freq_limit_hz = constrain(hz, 0, 100); refresh_frequency_limit(); } @@ -508,7 +508,7 @@ class Planner { #if HAS_CLASSIC_JERK static void set_max_jerk(const AxisEnum axis, float inMaxJerkMMS); #else - static inline void set_max_jerk(const AxisEnum, const_float_t) {} + static void set_max_jerk(const AxisEnum, const_float_t) {} #endif #if HAS_EXTRUDERS @@ -516,7 +516,7 @@ class Planner { e_factor[e] = flow_percentage[e] * 0.01f * TERN(NO_VOLUMETRICS, 1.0f, volumetric_multiplier[e]); } - static inline void set_flow(const uint8_t e, const int16_t flow) { + static void set_flow(const uint8_t e, const int16_t flow) { flow_percentage[e] = flow; refresh_e_factor(e); } @@ -539,7 +539,7 @@ class Planner { #if ENABLED(FILAMENT_WIDTH_SENSOR) void apply_filament_width_sensor(const int8_t encoded_ratio); - static inline float volumetric_percent(const bool vol) { + static float volumetric_percent(const bool vol) { return 100.0f * (vol ? volumetric_area_nominal / volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] : volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] @@ -588,7 +588,7 @@ class Planner { * Returns 1.0 if planner.z_fade_height is 0.0. * Returns 0.0 if Z is past the specified 'Fade Height'. */ - static inline float fade_scaling_factor_for_z(const_float_t rz) { + static float fade_scaling_factor_for_z(const_float_t rz) { static float z_fade_factor = 1; if (!z_fade_height) return 1; if (rz >= z_fade_height) return 0; @@ -838,7 +838,7 @@ class Planner { */ static float get_axis_position_mm(const AxisEnum axis); - static inline abce_pos_t get_axis_positions_mm() { + static abce_pos_t get_axis_positions_mm() { const abce_pos_t out = LOGICAL_AXIS_ARRAY( get_axis_position_mm(E_AXIS), get_axis_position_mm(A_AXIS), get_axis_position_mm(B_AXIS), get_axis_position_mm(C_AXIS), @@ -870,7 +870,7 @@ class Planner { static float triggered_position_mm(const AxisEnum axis); // Blocks are queued, or we're running out moves, or the closed loop controller is waiting - static inline bool busy() { + static bool busy() { return (has_blocks_queued() || cleaning_buffer_counter || TERN0(EXTERNAL_CLOSED_LOOP_CONTROLLER, CLOSED_LOOP_WAITING()) ); @@ -938,7 +938,7 @@ class Planner { #if ENABLED(AUTOTEMP_PROPORTIONAL) static void _autotemp_update_from_hotend(); #else - static inline void _autotemp_update_from_hotend() {} + static void _autotemp_update_from_hotend() {} #endif #endif diff --git a/Marlin/src/module/printcounter.h b/Marlin/src/module/printcounter.h index 4deae45a656d..931d14ded6da 100644 --- a/Marlin/src/module/printcounter.h +++ b/Marlin/src/module/printcounter.h @@ -112,7 +112,7 @@ class PrintCounter: public Stopwatch { /** * @brief Initialize the print counter */ - static inline void init() { + static void init() { super::init(); loadStats(); } @@ -176,8 +176,8 @@ class PrintCounter: public Stopwatch { */ static bool start(); static bool _stop(const bool completed); - static inline bool stop() { return _stop(true); } - static inline bool abort() { return _stop(false); } + static bool stop() { return _stop(true); } + static bool abort() { return _stop(false); } static void reset(); diff --git a/Marlin/src/module/settings.h b/Marlin/src/module/settings.h index 967d49c0738e..a8fca60baa12 100644 --- a/Marlin/src/module/settings.h +++ b/Marlin/src/module/settings.h @@ -59,7 +59,7 @@ class MarlinSettings { static bool load(); // Return 'true' if data was loaded ok static bool validate(); // Return 'true' if EEPROM data is ok - static inline void first_load() { + static void first_load() { static bool loaded = false; if (!loaded && load()) loaded = true; } diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index f170dd410458..6b190889cd31 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -457,11 +457,11 @@ class Stepper { // The stepper subsystem goes to sleep when it runs out of things to execute. // Call this to notify the subsystem that it is time to go to work. - static inline void wake_up() { ENABLE_STEPPER_DRIVER_INTERRUPT(); } + static void wake_up() { ENABLE_STEPPER_DRIVER_INTERRUPT(); } - static inline bool is_awake() { return STEPPER_ISR_ENABLED(); } + static bool is_awake() { return STEPPER_ISR_ENABLED(); } - static inline bool suspend() { + static bool suspend() { const bool awake = is_awake(); if (awake) DISABLE_STEPPER_DRIVER_INTERRUPT(); return awake; @@ -564,7 +564,7 @@ class Stepper { FORCE_INLINE static void set_z4_lock(const bool state) { locked_Z4_motor = state; } #endif #endif - static inline void set_all_z_lock(const bool lock, const int8_t except=-1) { + static void set_all_z_lock(const bool lock, const int8_t except=-1) { set_z1_lock(lock ^ (except == 0)); set_z2_lock(lock ^ (except == 1)); #if NUM_Z_STEPPER_DRIVERS >= 3 @@ -586,16 +586,16 @@ class Stepper { static axis_flags_t axis_enabled; // Axis stepper(s) ENABLED states - static inline bool axis_is_enabled(const AxisEnum axis E_OPTARG(const uint8_t eindex=0)) { + static bool axis_is_enabled(const AxisEnum axis E_OPTARG(const uint8_t eindex=0)) { return TEST(axis_enabled.bits, INDEX_OF_AXIS(axis, eindex)); } - static inline void mark_axis_enabled(const AxisEnum axis E_OPTARG(const uint8_t eindex=0)) { + static void mark_axis_enabled(const AxisEnum axis E_OPTARG(const uint8_t eindex=0)) { SBI(axis_enabled.bits, INDEX_OF_AXIS(axis, eindex)); } - static inline void mark_axis_disabled(const AxisEnum axis E_OPTARG(const uint8_t eindex=0)) { + static void mark_axis_disabled(const AxisEnum axis E_OPTARG(const uint8_t eindex=0)) { CBI(axis_enabled.bits, INDEX_OF_AXIS(axis, eindex)); } - static inline bool can_axis_disable(const AxisEnum axis E_OPTARG(const uint8_t eindex=0)) { + static bool can_axis_disable(const AxisEnum axis E_OPTARG(const uint8_t eindex=0)) { return !any_enable_overlap() || !(axis_enabled.bits & enable_overlap[INDEX_OF_AXIS(axis, eindex)]); } @@ -608,10 +608,10 @@ class Stepper { static void enable_e_steppers(); static void disable_e_steppers(); #else - static inline void enable_extruder() {} - static inline bool disable_extruder() { return true; } - static inline void enable_e_steppers() {} - static inline void disable_e_steppers() {} + static void enable_extruder() {} + static bool disable_extruder() { return true; } + static void enable_e_steppers() {} + static void disable_e_steppers() {} #endif #define ENABLE_EXTRUDER(N) enable_extruder(E_TERN_(N)) diff --git a/Marlin/src/module/stepper/trinamic.h b/Marlin/src/module/stepper/trinamic.h index 0a956a70b360..9ed9bdf407a8 100644 --- a/Marlin/src/module/stepper/trinamic.h +++ b/Marlin/src/module/stepper/trinamic.h @@ -74,12 +74,6 @@ #define TMC_CLASS_E(N) TMC_CLASS(E##N, E) #endif -typedef struct { - uint8_t toff; - int8_t hend; - uint8_t hstrt; -} chopper_timing_t; - #ifndef CHOPPER_TIMING_X #define CHOPPER_TIMING_X CHOPPER_TIMING #endif diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index 853a956d903c..e3515f0db870 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -359,7 +359,7 @@ class Temperature { #if HAS_HOTEND static hotend_info_t temp_hotend[HOTENDS]; static const celsius_t hotend_maxtemp[HOTENDS]; - static inline celsius_t hotend_max_target(const uint8_t e) { return hotend_maxtemp[e] - (HOTEND_OVERSHOOT); } + static celsius_t hotend_max_target(const uint8_t e) { return hotend_maxtemp[e] - (HOTEND_OVERSHOOT); } #endif #if HAS_HEATED_BED static bed_info_t temp_bed; @@ -402,16 +402,16 @@ class Temperature { #if ENABLED(PREVENT_COLD_EXTRUSION) static bool allow_cold_extrude; static celsius_t extrude_min_temp; - static inline bool tooCold(const celsius_t temp) { return allow_cold_extrude ? false : temp < extrude_min_temp - (TEMP_WINDOW); } - static inline bool tooColdToExtrude(const uint8_t E_NAME) { return tooCold(wholeDegHotend(HOTEND_INDEX)); } - static inline bool targetTooColdToExtrude(const uint8_t E_NAME) { return tooCold(degTargetHotend(HOTEND_INDEX)); } + static bool tooCold(const celsius_t temp) { return allow_cold_extrude ? false : temp < extrude_min_temp - (TEMP_WINDOW); } + static bool tooColdToExtrude(const uint8_t E_NAME) { return tooCold(wholeDegHotend(HOTEND_INDEX)); } + static bool targetTooColdToExtrude(const uint8_t E_NAME) { return tooCold(degTargetHotend(HOTEND_INDEX)); } #else - static inline bool tooColdToExtrude(const uint8_t) { return false; } - static inline bool targetTooColdToExtrude(const uint8_t) { return false; } + static bool tooColdToExtrude(const uint8_t) { return false; } + static bool targetTooColdToExtrude(const uint8_t) { return false; } #endif - static inline bool hotEnoughToExtrude(const uint8_t e) { return !tooColdToExtrude(e); } - static inline bool targetHotEnoughToExtrude(const uint8_t e) { return !targetTooColdToExtrude(e); } + static bool hotEnoughToExtrude(const uint8_t e) { return !tooColdToExtrude(e); } + static bool targetHotEnoughToExtrude(const uint8_t e) { return !targetTooColdToExtrude(e); } #if EITHER(SINGLENOZZLE_STANDBY_TEMP, SINGLENOZZLE_STANDBY_FAN) #if ENABLED(SINGLENOZZLE_STANDBY_TEMP) @@ -449,7 +449,7 @@ class Temperature { }; // Convert the given heater_id_t to idle array index - static inline IdleIndex idle_index_for_id(const int8_t heater_id) { + static IdleIndex idle_index_for_id(const int8_t heater_id) { TERN_(HAS_HEATED_BED, if (heater_id == H_BED) return IDLE_INDEX_BED); return (IdleIndex)_MAX(heater_id, 0); } @@ -525,7 +525,7 @@ class Temperature { #if HAS_FAN_LOGIC static millis_t fan_update_ms; - static inline void manage_extruder_fans(millis_t ms) { + static void manage_extruder_fans(millis_t ms) { if (ELAPSED(ms, fan_update_ms)) { // only need to check fan state very infrequently const millis_t next_ms = ms + fan_update_interval_ms; #if HAS_PWMFANCHECK @@ -566,25 +566,25 @@ class Temperature { static void M305_report(const uint8_t t_index, const bool forReplay=true); static void reset_user_thermistors(); static celsius_float_t user_thermistor_to_deg_c(const uint8_t t_index, const int16_t raw); - static inline bool set_pull_up_res(int8_t t_index, float value) { + static bool set_pull_up_res(int8_t t_index, float value) { //if (!WITHIN(t_index, 0, USER_THERMISTORS - 1)) return false; if (!WITHIN(value, 1, 1000000)) return false; user_thermistor[t_index].series_res = value; return true; } - static inline bool set_res25(int8_t t_index, float value) { + static bool set_res25(int8_t t_index, float value) { if (!WITHIN(value, 1, 10000000)) return false; user_thermistor[t_index].res_25 = value; user_thermistor[t_index].pre_calc = true; return true; } - static inline bool set_beta(int8_t t_index, float value) { + static bool set_beta(int8_t t_index, float value) { if (!WITHIN(value, 1, 1000000)) return false; user_thermistor[t_index].beta = value; user_thermistor[t_index].pre_calc = true; return true; } - static inline bool set_sh_coeff(int8_t t_index, float value) { + static bool set_sh_coeff(int8_t t_index, float value) { if (!WITHIN(value, -0.01f, 0.01f)) return false; user_thermistor[t_index].sh_c_coeff = value; user_thermistor[t_index].pre_calc = true; @@ -634,18 +634,18 @@ class Temperature { static uint8_t fan_speed_scaler[FAN_COUNT]; #endif - static inline uint8_t scaledFanSpeed(const uint8_t fan, const uint8_t fs) { + static uint8_t scaledFanSpeed(const uint8_t fan, const uint8_t fs) { UNUSED(fan); // Potentially unused! return (fs * uint16_t(TERN(ADAPTIVE_FAN_SLOWING, fan_speed_scaler[fan], 128))) >> 7; } - static inline uint8_t scaledFanSpeed(const uint8_t fan) { + static uint8_t scaledFanSpeed(const uint8_t fan) { return scaledFanSpeed(fan, fan_speed[fan]); } static constexpr inline uint8_t pwmToPercent(const uint8_t speed) { return ui8_to_percent(speed); } - static inline uint8_t fanSpeedPercent(const uint8_t fan) { return ui8_to_percent(fan_speed[fan]); } - static inline uint8_t scaledFanSpeedPercent(const uint8_t fan) { return ui8_to_percent(scaledFanSpeed(fan)); } + static uint8_t fanSpeedPercent(const uint8_t fan) { return ui8_to_percent(fan_speed[fan]); } + static uint8_t scaledFanSpeedPercent(const uint8_t fan) { return ui8_to_percent(scaledFanSpeed(fan)); } #if ENABLED(EXTRA_FAN_SPEED) typedef struct { uint8_t saved, speed; } extra_fan_t; @@ -659,7 +659,7 @@ class Temperature { #endif // HAS_FAN - static inline void zero_fan_speeds() { + static void zero_fan_speeds() { #if HAS_FAN FANS_LOOP(i) set_fan_speed(i, 0); #endif @@ -680,13 +680,13 @@ class Temperature { * Preheating hotends */ #if MILLISECONDS_PREHEAT_TIME > 0 - static inline bool is_preheating(const uint8_t E_NAME) { + static bool is_preheating(const uint8_t E_NAME) { return preheat_end_time[HOTEND_INDEX] && PENDING(millis(), preheat_end_time[HOTEND_INDEX]); } - static inline void start_preheat_time(const uint8_t E_NAME) { + static void start_preheat_time(const uint8_t E_NAME) { preheat_end_time[HOTEND_INDEX] = millis() + MILLISECONDS_PREHEAT_TIME; } - static inline void reset_preheat_time(const uint8_t E_NAME) { + static void reset_preheat_time(const uint8_t E_NAME) { preheat_end_time[HOTEND_INDEX] = 0; } #else @@ -697,21 +697,21 @@ class Temperature { //inline so that there is no performance decrease. //deg=degreeCelsius - static inline celsius_float_t degHotend(const uint8_t E_NAME) { + static celsius_float_t degHotend(const uint8_t E_NAME) { return TERN0(HAS_HOTEND, temp_hotend[HOTEND_INDEX].celsius); } - static inline celsius_t wholeDegHotend(const uint8_t E_NAME) { + static celsius_t wholeDegHotend(const uint8_t E_NAME) { return TERN0(HAS_HOTEND, static_cast(temp_hotend[HOTEND_INDEX].celsius + 0.5f)); } #if ENABLED(SHOW_TEMP_ADC_VALUES) - static inline int16_t rawHotendTemp(const uint8_t E_NAME) { + static int16_t rawHotendTemp(const uint8_t E_NAME) { return TERN0(HAS_HOTEND, temp_hotend[HOTEND_INDEX].raw); } #endif - static inline celsius_t degTargetHotend(const uint8_t E_NAME) { + static celsius_t degTargetHotend(const uint8_t E_NAME) { return TERN0(HAS_HOTEND, temp_hotend[HOTEND_INDEX].target); } @@ -730,11 +730,11 @@ class Temperature { start_watching_hotend(ee); } - static inline bool isHeatingHotend(const uint8_t E_NAME) { + static bool isHeatingHotend(const uint8_t E_NAME) { return temp_hotend[HOTEND_INDEX].target > temp_hotend[HOTEND_INDEX].celsius; } - static inline bool isCoolingHotend(const uint8_t E_NAME) { + static bool isCoolingHotend(const uint8_t E_NAME) { return temp_hotend[HOTEND_INDEX].target < temp_hotend[HOTEND_INDEX].celsius; } @@ -748,16 +748,16 @@ class Temperature { #endif #endif - static inline bool still_heating(const uint8_t e) { + static bool still_heating(const uint8_t e) { return degTargetHotend(e) > TEMP_HYSTERESIS && ABS(wholeDegHotend(e) - degTargetHotend(e)) > TEMP_HYSTERESIS; } - static inline bool degHotendNear(const uint8_t e, const celsius_t temp) { + static bool degHotendNear(const uint8_t e, const celsius_t temp) { return ABS(wholeDegHotend(e) - temp) < (TEMP_HYSTERESIS); } // Start watching a Hotend to make sure it's really heating up - static inline void start_watching_hotend(const uint8_t E_NAME) { + static void start_watching_hotend(const uint8_t E_NAME) { UNUSED(HOTEND_INDEX); #if WATCH_HOTENDS watch_hotend[HOTEND_INDEX].restart(degHotend(HOTEND_INDEX), degTargetHotend(HOTEND_INDEX)); @@ -769,16 +769,16 @@ class Temperature { #if HAS_HEATED_BED #if ENABLED(SHOW_TEMP_ADC_VALUES) - static inline int16_t rawBedTemp() { return temp_bed.raw; } + static int16_t rawBedTemp() { return temp_bed.raw; } #endif - static inline celsius_float_t degBed() { return temp_bed.celsius; } - static inline celsius_t wholeDegBed() { return static_cast(degBed() + 0.5f); } - static inline celsius_t degTargetBed() { return temp_bed.target; } - static inline bool isHeatingBed() { return temp_bed.target > temp_bed.celsius; } - static inline bool isCoolingBed() { return temp_bed.target < temp_bed.celsius; } + static celsius_float_t degBed() { return temp_bed.celsius; } + static celsius_t wholeDegBed() { return static_cast(degBed() + 0.5f); } + static celsius_t degTargetBed() { return temp_bed.target; } + static bool isHeatingBed() { return temp_bed.target > temp_bed.celsius; } + static bool isCoolingBed() { return temp_bed.target < temp_bed.celsius; } // Start watching the Bed to make sure it's really heating up - static inline void start_watching_bed() { TERN_(WATCH_BED, watch_bed.restart(degBed(), degTargetBed())); } + static void start_watching_bed() { TERN_(WATCH_BED, watch_bed.restart(degBed(), degTargetBed())); } static void setTargetBed(const celsius_t celsius) { TERN_(AUTO_POWER_CONTROL, if (celsius) powerManager.power_on()); @@ -792,7 +792,7 @@ class Temperature { static void wait_for_bed_heating(); - static inline bool degBedNear(const celsius_t temp) { + static bool degBedNear(const celsius_t temp) { return ABS(wholeDegBed() - temp) < (TEMP_BED_HYSTERESIS); } @@ -800,25 +800,25 @@ class Temperature { #if HAS_TEMP_PROBE #if ENABLED(SHOW_TEMP_ADC_VALUES) - static inline int16_t rawProbeTemp() { return temp_probe.raw; } + static int16_t rawProbeTemp() { return temp_probe.raw; } #endif - static inline celsius_float_t degProbe() { return temp_probe.celsius; } - static inline celsius_t wholeDegProbe() { return static_cast(degProbe() + 0.5f); } - static inline bool isProbeBelowTemp(const celsius_t target_temp) { return wholeDegProbe() < target_temp; } - static inline bool isProbeAboveTemp(const celsius_t target_temp) { return wholeDegProbe() > target_temp; } + static celsius_float_t degProbe() { return temp_probe.celsius; } + static celsius_t wholeDegProbe() { return static_cast(degProbe() + 0.5f); } + static bool isProbeBelowTemp(const celsius_t target_temp) { return wholeDegProbe() < target_temp; } + static bool isProbeAboveTemp(const celsius_t target_temp) { return wholeDegProbe() > target_temp; } static bool wait_for_probe(const celsius_t target_temp, bool no_wait_for_cooling=true); #endif #if HAS_TEMP_CHAMBER #if ENABLED(SHOW_TEMP_ADC_VALUES) - static inline int16_t rawChamberTemp() { return temp_chamber.raw; } + static int16_t rawChamberTemp() { return temp_chamber.raw; } #endif - static inline celsius_float_t degChamber() { return temp_chamber.celsius; } - static inline celsius_t wholeDegChamber() { return static_cast(degChamber() + 0.5f); } + static celsius_float_t degChamber() { return temp_chamber.celsius; } + static celsius_t wholeDegChamber() { return static_cast(degChamber() + 0.5f); } #if HAS_HEATED_CHAMBER - static inline celsius_t degTargetChamber() { return temp_chamber.target; } - static inline bool isHeatingChamber() { return temp_chamber.target > temp_chamber.celsius; } - static inline bool isCoolingChamber() { return temp_chamber.target < temp_chamber.celsius; } + static celsius_t degTargetChamber() { return temp_chamber.target; } + static bool isHeatingChamber() { return temp_chamber.target > temp_chamber.celsius; } + static bool isCoolingChamber() { return temp_chamber.target < temp_chamber.celsius; } static bool wait_for_chamber(const bool no_wait_for_cooling=true); #endif #endif @@ -829,49 +829,49 @@ class Temperature { start_watching_chamber(); } // Start watching the Chamber to make sure it's really heating up - static inline void start_watching_chamber() { TERN_(WATCH_CHAMBER, watch_chamber.restart(degChamber(), degTargetChamber())); } + static void start_watching_chamber() { TERN_(WATCH_CHAMBER, watch_chamber.restart(degChamber(), degTargetChamber())); } #endif #if HAS_TEMP_COOLER #if ENABLED(SHOW_TEMP_ADC_VALUES) - static inline int16_t rawCoolerTemp() { return temp_cooler.raw; } + static int16_t rawCoolerTemp() { return temp_cooler.raw; } #endif - static inline celsius_float_t degCooler() { return temp_cooler.celsius; } - static inline celsius_t wholeDegCooler() { return static_cast(temp_cooler.celsius + 0.5f); } + static celsius_float_t degCooler() { return temp_cooler.celsius; } + static celsius_t wholeDegCooler() { return static_cast(temp_cooler.celsius + 0.5f); } #if HAS_COOLER - static inline celsius_t degTargetCooler() { return temp_cooler.target; } - static inline bool isLaserHeating() { return temp_cooler.target > temp_cooler.celsius; } - static inline bool isLaserCooling() { return temp_cooler.target < temp_cooler.celsius; } + static celsius_t degTargetCooler() { return temp_cooler.target; } + static bool isLaserHeating() { return temp_cooler.target > temp_cooler.celsius; } + static bool isLaserCooling() { return temp_cooler.target < temp_cooler.celsius; } static bool wait_for_cooler(const bool no_wait_for_cooling=true); #endif #endif #if HAS_TEMP_BOARD #if ENABLED(SHOW_TEMP_ADC_VALUES) - static inline int16_t rawBoardTemp() { return temp_board.raw; } + static int16_t rawBoardTemp() { return temp_board.raw; } #endif - static inline celsius_float_t degBoard() { return temp_board.celsius; } - static inline celsius_t wholeDegBoard() { return static_cast(temp_board.celsius + 0.5f); } + static celsius_float_t degBoard() { return temp_board.celsius; } + static celsius_t wholeDegBoard() { return static_cast(temp_board.celsius + 0.5f); } #endif #if HAS_TEMP_REDUNDANT #if ENABLED(SHOW_TEMP_ADC_VALUES) - static inline int16_t rawRedundantTemp() { return temp_redundant.raw; } - static inline int16_t rawRedundanTargetTemp() { return (*temp_redundant.target).raw; } + static int16_t rawRedundantTemp() { return temp_redundant.raw; } + static int16_t rawRedundanTargetTemp() { return (*temp_redundant.target).raw; } #endif - static inline celsius_float_t degRedundant() { return temp_redundant.celsius; } - static inline celsius_float_t degRedundantTarget() { return (*temp_redundant.target).celsius; } - static inline celsius_t wholeDegRedundant() { return static_cast(temp_redundant.celsius + 0.5f); } - static inline celsius_t wholeDegRedundantTarget() { return static_cast((*temp_redundant.target).celsius + 0.5f); } + static celsius_float_t degRedundant() { return temp_redundant.celsius; } + static celsius_float_t degRedundantTarget() { return (*temp_redundant.target).celsius; } + static celsius_t wholeDegRedundant() { return static_cast(temp_redundant.celsius + 0.5f); } + static celsius_t wholeDegRedundantTarget() { return static_cast((*temp_redundant.target).celsius + 0.5f); } #endif #if HAS_COOLER - static inline void setTargetCooler(const celsius_t celsius) { + static void setTargetCooler(const celsius_t celsius) { temp_cooler.target = constrain(celsius, COOLER_MIN_TARGET, COOLER_MAX_TARGET); start_watching_cooler(); } // Start watching the Cooler to make sure it's really cooling down - static inline void start_watching_cooler() { TERN_(WATCH_COOLER, watch_cooler.restart(degCooler(), degTargetCooler())); } + static void start_watching_cooler() { TERN_(WATCH_COOLER, watch_cooler.restart(degCooler(), degTargetCooler())); } #endif /** @@ -887,7 +887,7 @@ class Temperature { /** * Cooldown, as from the LCD. Disables all heaters and fans. */ - static inline void cooldown() { + static void cooldown() { zero_fan_speeds(); disable_all_heaters(); } @@ -921,7 +921,7 @@ class Temperature { * Update the temp manager when PID values change */ #if ENABLED(PIDTEMP) - static inline void updatePID() { + static void updatePID() { TERN_(PID_EXTRUSION_SCALING, last_e_position = 0); } #endif @@ -934,13 +934,13 @@ class Temperature { #if HEATER_IDLE_HANDLER - static inline void reset_hotend_idle_timer(const uint8_t E_NAME) { + static void reset_hotend_idle_timer(const uint8_t E_NAME) { heater_idle[HOTEND_INDEX].reset(); start_watching_hotend(HOTEND_INDEX); } #if HAS_HEATED_BED - static inline void reset_bed_idle_timer() { + static void reset_bed_idle_timer() { heater_idle[IDLE_INDEX_BED].reset(); start_watching_bed(); } @@ -961,7 +961,7 @@ class Temperature { #if HAS_HOTEND && HAS_STATUS_MESSAGE static void set_heating_message(const uint8_t e); #else - static inline void set_heating_message(const uint8_t) {} + static void set_heating_message(const uint8_t) {} #endif #if HAS_LCD_MENU && HAS_TEMPERATURE @@ -974,7 +974,7 @@ class Temperature { static volatile bool raw_temps_ready; static void update_raw_temperatures(); static void updateTemperaturesFromRawValues(); - static inline bool updateTemperaturesIfReady() { + static bool updateTemperaturesIfReady() { if (!raw_temps_ready) return false; updateTemperaturesFromRawValues(); raw_temps_ready = false; @@ -1028,7 +1028,7 @@ class Temperature { }; // Convert the given heater_id_t to runaway state array index - static inline RunawayIndex runaway_index_for_id(const int8_t heater_id) { + static RunawayIndex runaway_index_for_id(const int8_t heater_id) { TERN_(THERMAL_PROTECTION_CHAMBER, if (heater_id == H_CHAMBER) return RUNAWAY_IND_CHAMBER); TERN_(THERMAL_PROTECTION_COOLER, if (heater_id == H_COOLER) return RUNAWAY_IND_COOLER); TERN_(THERMAL_PROTECTION_BED, if (heater_id == H_BED) return RUNAWAY_IND_BED); diff --git a/Marlin/src/pins/mega/pins_MEGACONTROLLER.h b/Marlin/src/pins/mega/pins_MEGACONTROLLER.h index 69c60b29ec54..0af37bb217ed 100644 --- a/Marlin/src/pins/mega/pins_MEGACONTROLLER.h +++ b/Marlin/src/pins/mega/pins_MEGACONTROLLER.h @@ -121,7 +121,7 @@ #define CONTROLLER_FAN_PIN FAN2_PIN #endif -#define FAN_SOFT_PWM +#define FAN_SOFT_PWM_REQUIRED // // Misc. Functions diff --git a/Marlin/src/pins/stm32f1/pins_BEAST.h b/Marlin/src/pins/stm32f1/pins_BEAST.h index 2ace47822e16..d494b29c1448 100644 --- a/Marlin/src/pins/stm32f1/pins_BEAST.h +++ b/Marlin/src/pins/stm32f1/pins_BEAST.h @@ -93,7 +93,7 @@ #define FAN_PIN PB10 #endif -#define FAN_SOFT_PWM +#define FAN_SOFT_PWM_REQUIRED // // Temperature Sensors diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h index 570d102c4758..7b8abb130060 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h @@ -113,7 +113,7 @@ #define HEATER_BED_PIN PC9 // HOT BED #define FAN_PIN PC6 // FAN -#define FAN_SOFT_PWM +#define FAN_SOFT_PWM_REQUIRED #define CONTROLLER_FAN_PIN PC7 diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D.h b/Marlin/src/pins/stm32f1/pins_CHITU3D.h index 2d33fb9f2cc2..7d30d6efad88 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D.h @@ -87,7 +87,7 @@ #define FAN_PIN PG14 // MAIN BOARD FAN #endif -#define FAN_SOFT_PWM +#define FAN_SOFT_PWM_REQUIRED // // Temperature Sensors diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h index bf2a55fc7b99..cb7e784751a4 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h @@ -143,9 +143,7 @@ #ifndef FAN_PIN #define FAN_PIN PA0 // FAN #endif -#if PIN_EXISTS(FAN) - #define FAN_SOFT_PWM -#endif +#define FAN_SOFT_PWM_REQUIRED // // SD Card diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h index 5251c8547b05..4941949f8116 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h @@ -144,7 +144,7 @@ #define HEATER_BED_PIN PA1 // HOT BED #define FAN_PIN PA2 // FAN -#define FAN_SOFT_PWM +#define FAN_SOFT_PWM_REQUIRED // // SD Card diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V45x.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V45x.h index 023fca21ce98..85d279872d55 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V45x.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V45x.h @@ -97,7 +97,7 @@ // Heaters / Fans // -#define FAN_SOFT_PWM +#define FAN_SOFT_PWM_REQUIRED // // SD Card diff --git a/Marlin/src/pins/stm32f1/pins_ERYONE_ERY32_MINI.h b/Marlin/src/pins/stm32f1/pins_ERYONE_ERY32_MINI.h index fea5b00b50d8..0682bfd73620 100644 --- a/Marlin/src/pins/stm32f1/pins_ERYONE_ERY32_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_ERYONE_ERY32_MINI.h @@ -38,10 +38,9 @@ //#define DISABLE_DEBUG #define DISABLE_JTAG //#define ENABLE_SPI3 -#define FLASH_EEPROM_EMULATION -#define FAN_SOFT_PWM -#if ENABLED(FLASH_EEPROM_EMULATION) +#if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) + #define FLASH_EEPROM_EMULATION #define EEPROM_PAGE_SIZE (0x800U) // 2KB #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL) #define MARLIN_EEPROM_SIZE (EEPROM_PAGE_SIZE) @@ -118,6 +117,8 @@ #endif #endif +#define FAN_SOFT_PWM_REQUIRED + // // Misc. Functions // diff --git a/Marlin/src/pins/stm32f1/pins_FLY_MINI.h b/Marlin/src/pins/stm32f1/pins_FLY_MINI.h index bfddf051f692..5468d0b4bd7c 100644 --- a/Marlin/src/pins/stm32f1/pins_FLY_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_FLY_MINI.h @@ -30,10 +30,12 @@ // // Flash EEPROM Emulation // -#define FLASH_EEPROM_EMULATION -#define EEPROM_PAGE_SIZE 0x800 // 2KB -#define EEPROM_START_ADDRESS (0x8000000 + 256 * 1024 - 2 * EEPROM_PAGE_SIZE) // 256K firmware space -#define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE +#if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) + #define FLASH_EEPROM_EMULATION + #define EEPROM_PAGE_SIZE 0x800 // 2KB + #define EEPROM_START_ADDRESS (0x8000000 + 256 * 1024 - 2 * EEPROM_PAGE_SIZE) // 256K firmware space + #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE +#endif // // Servos diff --git a/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h b/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h index 15c6955a83a8..ca5ae45b3b75 100644 --- a/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h +++ b/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h @@ -90,13 +90,19 @@ #define FAN_PIN PA15 // pin 77 (4cm Fan) #ifdef MAPLE_STM32F1 - #define FAN_SOFT_PWM // Required to avoid issues with heating or STLink - #define FAN_MIN_PWM 35 // Fan will not start in 1-30 range - #define FAN_MAX_PWM 255 + #define FAN_SOFT_PWM_REQUIRED + #if ENABLED(FAN_SOFT_PWM) && FAN_MIN_PWM < 35 // Required to avoid issues with heating or STLink + #error "FAN_MIN_PWM must be 35 or higher." // Fan will not start in 1-30 range + #endif +#elif ENABLED(FAST_PWM_FAN) + #if FAST_PWM_FAN_FREQUENCY != 31400 // Default 1000 is noisy, max 65K (uint16) + #error "FAST_PWM_FAN_FREQUENCY must be set to 31400." + #endif + #if FAN_MIN_PWM < 5 + #error "FAN_MIN_PWM must be 5 or higher." + #endif #else - #define FAST_PWM_FAN // STM32 Variant allow TIMER2 Hardware PWM - #define FAN_MIN_PWM 5 - #define FAN_MAX_PWM 255 + #error "FAST_PWM_FAN required to allow TIMER2 Hardware PWM." #endif //#define BEEPER_PIN PD13 // pin 60 (Servo PWM output 5V/GND on Board V0G+) made for BL-Touch sensor diff --git a/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h b/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h index 7171de919d03..e189fc3f97b9 100644 --- a/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h @@ -91,7 +91,7 @@ #endif #define FAN1_PIN PD13 -#define FAN_SOFT_PWM +#define FAN_SOFT_PWM_REQUIRED // // Temperature Sensors diff --git a/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h b/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h index bf38955127e4..6c7e7cbbfa48 100644 --- a/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h +++ b/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h @@ -45,7 +45,9 @@ // // EEPROM // -#define FLASH_EEPROM_EMULATION +#if NO_EEPROM_SELECTED + #define FLASH_EEPROM_EMULATION +#endif #if ENABLED(FLASH_EEPROM_EMULATION) // SoC Flash (framework-arduinoststm32-maple/STM32F1/libraries/EEPROM/EEPROM.h) #define EEPROM_START_ADDRESS (0x8000000UL + (512 * 1024) - 2 * EEPROM_PAGE_SIZE) diff --git a/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h b/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h index 4cf9768fbe80..6d5928e86d58 100644 --- a/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h +++ b/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h @@ -29,8 +29,10 @@ #define BOARD_INFO_NAME "Artillery Ruby" -#define FLASH_EEPROM_EMULATION -//#define I2C_EEPROM +#if NO_EEPROM_SELECTED + #define FLASH_EEPROM_EMULATION + //#define I2C_EEPROM +#endif //#define E2END 0xFFF // 4KB #define HAL_TIMER_RATE F_CPU diff --git a/Marlin/src/pins/stm32f4/pins_INDEX_REV03.h b/Marlin/src/pins/stm32f4/pins_INDEX_REV03.h index 8560a04375c0..a9828c5bdaef 100644 --- a/Marlin/src/pins/stm32f4/pins_INDEX_REV03.h +++ b/Marlin/src/pins/stm32f4/pins_INDEX_REV03.h @@ -119,7 +119,7 @@ #define FAN2_PIN PE4 #define FAN3_PIN PE5 -#define FAN_SOFT_PWM +#define FAN_SOFT_PWM_REQUIRED // Neopixel Rings #define NEOPIXEL_PIN PC7 diff --git a/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h b/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h index cf7c9ed8a681..873a4d4ad382 100644 --- a/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h +++ b/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h @@ -35,7 +35,7 @@ // Use soft PWM for fans - PWM is not working properly when paired with STM32 Arduino Core v1.7.0 // This can be removed when Core version is updated and PWM behaviour is fixed. -#define FAN_SOFT_PWM +#define FAN_SOFT_PWM_REQUIRED // // Configure Timers diff --git a/Marlin/src/sd/Sd2Card.cpp b/Marlin/src/sd/Sd2Card.cpp index a81932d49485..3402bfaee382 100644 --- a/Marlin/src/sd/Sd2Card.cpp +++ b/Marlin/src/sd/Sd2Card.cpp @@ -392,50 +392,51 @@ bool DiskIODriver_SPI_SD::readData(uint8_t *dst) { #if ENABLED(SD_CHECK_AND_RETRY) #ifdef FAST_CRC - static const uint16_t crctab16[] PROGMEM = { - 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7, - 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF, - 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6, - 0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE, - 0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485, - 0xA56A, 0xB54B, 0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D, - 0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4, - 0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC, - 0x48C4, 0x58E5, 0x6886, 0x78A7, 0x0840, 0x1861, 0x2802, 0x3823, - 0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B, - 0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12, - 0xDBFD, 0xCBDC, 0xFBBF, 0xEB9E, 0x9B79, 0x8B58, 0xBB3B, 0xAB1A, - 0x6CA6, 0x7C87, 0x4CE4, 0x5CC5, 0x2C22, 0x3C03, 0x0C60, 0x1C41, - 0xEDAE, 0xFD8F, 0xCDEC, 0xDDCD, 0xAD2A, 0xBD0B, 0x8D68, 0x9D49, - 0x7E97, 0x6EB6, 0x5ED5, 0x4EF4, 0x3E13, 0x2E32, 0x1E51, 0x0E70, - 0xFF9F, 0xEFBE, 0xDFDD, 0xCFFC, 0xBF1B, 0xAF3A, 0x9F59, 0x8F78, - 0x9188, 0x81A9, 0xB1CA, 0xA1EB, 0xD10C, 0xC12D, 0xF14E, 0xE16F, - 0x1080, 0x00A1, 0x30C2, 0x20E3, 0x5004, 0x4025, 0x7046, 0x6067, - 0x83B9, 0x9398, 0xA3FB, 0xB3DA, 0xC33D, 0xD31C, 0xE37F, 0xF35E, - 0x02B1, 0x1290, 0x22F3, 0x32D2, 0x4235, 0x5214, 0x6277, 0x7256, - 0xB5EA, 0xA5CB, 0x95A8, 0x8589, 0xF56E, 0xE54F, 0xD52C, 0xC50D, - 0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, - 0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C, - 0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634, - 0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB, - 0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3, - 0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A, - 0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92, - 0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9, - 0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1, - 0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8, - 0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0 - }; + static const uint16_t crctab16[] PROGMEM = { + 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7, + 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF, + 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6, + 0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE, + 0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485, + 0xA56A, 0xB54B, 0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D, + 0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4, + 0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC, + 0x48C4, 0x58E5, 0x6886, 0x78A7, 0x0840, 0x1861, 0x2802, 0x3823, + 0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B, + 0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12, + 0xDBFD, 0xCBDC, 0xFBBF, 0xEB9E, 0x9B79, 0x8B58, 0xBB3B, 0xAB1A, + 0x6CA6, 0x7C87, 0x4CE4, 0x5CC5, 0x2C22, 0x3C03, 0x0C60, 0x1C41, + 0xEDAE, 0xFD8F, 0xCDEC, 0xDDCD, 0xAD2A, 0xBD0B, 0x8D68, 0x9D49, + 0x7E97, 0x6EB6, 0x5ED5, 0x4EF4, 0x3E13, 0x2E32, 0x1E51, 0x0E70, + 0xFF9F, 0xEFBE, 0xDFDD, 0xCFFC, 0xBF1B, 0xAF3A, 0x9F59, 0x8F78, + 0x9188, 0x81A9, 0xB1CA, 0xA1EB, 0xD10C, 0xC12D, 0xF14E, 0xE16F, + 0x1080, 0x00A1, 0x30C2, 0x20E3, 0x5004, 0x4025, 0x7046, 0x6067, + 0x83B9, 0x9398, 0xA3FB, 0xB3DA, 0xC33D, 0xD31C, 0xE37F, 0xF35E, + 0x02B1, 0x1290, 0x22F3, 0x32D2, 0x4235, 0x5214, 0x6277, 0x7256, + 0xB5EA, 0xA5CB, 0x95A8, 0x8589, 0xF56E, 0xE54F, 0xD52C, 0xC50D, + 0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, + 0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C, + 0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634, + 0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB, + 0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3, + 0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A, + 0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92, + 0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9, + 0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1, + 0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8, + 0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0 + }; // faster CRC-CCITT // uses the x^16,x^12,x^5,x^1 polynomial. - static uint16_t CRC_CCITT(const uint8_t *data, size_t n) { - uint16_t crc = 0; - for (size_t i = 0; i < n; i++) { - crc = pgm_read_word(&crctab16[(crc >> 8 ^ data[i]) & 0xFF]) ^ (crc << 8); + static uint16_t CRC_CCITT(const uint8_t *data, size_t n) { + uint16_t crc = 0; + for (size_t i = 0; i < n; i++) + crc = pgm_read_word(&crctab16[(crc >> 8 ^ data[i]) & 0xFF]) ^ (crc << 8); + return crc; } - return crc; - } + #else + // slower CRC-CCITT // uses the x^16,x^12,x^5,x^1 polynomial. static uint16_t CRC_CCITT(const uint8_t *data, size_t n) { @@ -449,7 +450,9 @@ bool DiskIODriver_SPI_SD::readData(uint8_t *dst) { } return crc; } + #endif + #endif // SD_CHECK_AND_RETRY bool DiskIODriver_SPI_SD::readData(uint8_t *dst, const uint16_t count) { diff --git a/Marlin/src/sd/cardreader.h b/Marlin/src/sd/cardreader.h index 53e1a7ffc3cb..97e9bba86757 100644 --- a/Marlin/src/sd/cardreader.h +++ b/Marlin/src/sd/cardreader.h @@ -115,7 +115,7 @@ class CardReader { static void mount(); static void release(); - static inline bool isMounted() { return flag.mounted; } + static bool isMounted() { return flag.mounted; } // Handle media insert/remove static void manage_media(); @@ -128,7 +128,7 @@ class CardReader { static uint8_t autofile_index; // Next auto#.g index to run, plus one. Ignored by autofile_check when zero. static void autofile_begin(); // Begin check. Called automatically after boot-up. static bool autofile_check(); // Check for the next auto-start file and run it. - static inline void autofile_cancel() { autofile_index = 0; } + static void autofile_cancel() { autofile_index = 0; } #endif // Basic file ops @@ -138,7 +138,7 @@ class CardReader { static bool fileExists(const char * const name); static void removeFile(const char * const name); - static inline char* longest_filename() { return longFilename[0] ? longFilename : filename; } + static char* longest_filename() { return longFilename[0] ? longFilename : filename; } #if ENABLED(LONG_FILENAME_HOST_SUPPORT) static void printLongPath(char * const path); // Used by M33 #endif @@ -163,18 +163,18 @@ class CardReader { static void endFilePrintNow(TERN_(SD_RESORT, const bool re_sort=false)); static void abortFilePrintNow(TERN_(SD_RESORT, const bool re_sort=false)); static void fileHasFinished(); - static inline void abortFilePrintSoon() { flag.abort_sd_printing = isFileOpen(); } - static inline void pauseSDPrint() { flag.sdprinting = false; } - static inline bool isPrinting() { return flag.sdprinting; } - static inline bool isPaused() { return isFileOpen() && !isPrinting(); } + static void abortFilePrintSoon() { flag.abort_sd_printing = isFileOpen(); } + static void pauseSDPrint() { flag.sdprinting = false; } + static bool isPrinting() { return flag.sdprinting; } + static bool isPaused() { return isFileOpen() && !isPrinting(); } #if HAS_PRINT_PROGRESS_PERMYRIAD - static inline uint16_t permyriadDone() { + static uint16_t permyriadDone() { if (flag.sdprintdone) return 10000; if (isFileOpen() && filesize) return sdpos / ((filesize + 9999) / 10000); return 0; } #endif - static inline uint8_t percentDone() { + static uint8_t percentDone() { if (flag.sdprintdone) return 100; if (isFileOpen() && filesize) return sdpos / ((filesize + 99) / 100); return 0; @@ -213,20 +213,20 @@ class CardReader { #endif // Current Working Dir - Set by cd, cdup, cdroot, and diveToFile(true, ...) - static inline char* getWorkDirName() { workDir.getDosName(filename); return filename; } - static inline SdFile& getWorkDir() { return workDir.isOpen() ? workDir : root; } + static char* getWorkDirName() { workDir.getDosName(filename); return filename; } + static SdFile& getWorkDir() { return workDir.isOpen() ? workDir : root; } // Print File stats - static inline uint32_t getFileSize() { return filesize; } - static inline uint32_t getIndex() { return sdpos; } - static inline bool isFileOpen() { return isMounted() && file.isOpen(); } - static inline bool eof() { return getIndex() >= getFileSize(); } + static uint32_t getFileSize() { return filesize; } + static uint32_t getIndex() { return sdpos; } + static bool isFileOpen() { return isMounted() && file.isOpen(); } + static bool eof() { return getIndex() >= getFileSize(); } // File data operations - static inline int16_t get() { int16_t out = (int16_t)file.read(); sdpos = file.curPosition(); return out; } - static inline int16_t read(void *buf, uint16_t nbyte) { return file.isOpen() ? file.read(buf, nbyte) : -1; } - static inline int16_t write(void *buf, uint16_t nbyte) { return file.isOpen() ? file.write(buf, nbyte) : -1; } - static inline void setIndex(const uint32_t index) { file.seekSet((sdpos = index)); } + static int16_t get() { int16_t out = (int16_t)file.read(); sdpos = file.curPosition(); return out; } + static int16_t read(void *buf, uint16_t nbyte) { return file.isOpen() ? file.read(buf, nbyte) : -1; } + static int16_t write(void *buf, uint16_t nbyte) { return file.isOpen() ? file.write(buf, nbyte) : -1; } + static void setIndex(const uint32_t index) { file.seekSet((sdpos = index)); } // TODO: rename to diskIODriver() static DiskIODriver* diskIODriver() { return driver; } diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp index a1a3b7d50ead..9ff9cd77bc8b 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp @@ -47,7 +47,7 @@ void MAX3421e::regWr(uint8_t reg, uint8_t data) { spiSend(reg | 0x02); spiSend(data); ncs(); -}; +} // multiple-byte write // return a pointer to memory position after last written diff --git a/buildroot/tests/STM32F103RET6_creality b/buildroot/tests/STM32F103RET6_creality index ca7573cf16c3..8eda5f801dd4 100755 --- a/buildroot/tests/STM32F103RET6_creality +++ b/buildroot/tests/STM32F103RET6_creality @@ -30,7 +30,7 @@ exec_test $1 $2 "Ender 3 v2 with MarlinUI" "$3" restore_configs opt_set MOTHERBOARD BOARD_CREALITY_V452 SERIAL_PORT 1 opt_disable NOZZLE_TO_PROBE_OFFSET -opt_enable NOZZLE_AS_PROBE Z_SAFE_HOMING Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN \ +opt_enable NOZZLE_AS_PROBE Z_SAFE_HOMING Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN FAN_SOFT_PWM \ PROBE_ACTIVATION_SWITCH PROBE_TARE PROBE_TARE_ONLY_WHILE_INACTIVE exec_test $1 $2 "Creality V4.5.2 PROBE_ACTIVATION_SWITCH, Probe Tare" "$3" diff --git a/buildroot/tests/STM32F103RE_btt_USB b/buildroot/tests/STM32F103RE_btt_USB index c63a90e43681..7b264ea28312 100755 --- a/buildroot/tests/STM32F103RE_btt_USB +++ b/buildroot/tests/STM32F103RE_btt_USB @@ -15,7 +15,7 @@ exec_test $1 $2 "BigTreeTech SKR E3 DIP v1.0 - Basic Configuration" "$3" restore_configs opt_set MOTHERBOARD BOARD_BTT_SKR_CR6 SERIAL_PORT -1 SERIAL_PORT_2 2 TEMP_SENSOR_BED 1 -opt_enable CR10_STOCKDISPLAY \ +opt_enable CR10_STOCKDISPLAY FAN_SOFT_PWM \ NOZZLE_AS_PROBE Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN Z_SAFE_HOMING \ PROBE_ACTIVATION_SWITCH PROBE_TARE PROBE_TARE_ONLY_WHILE_INACTIVE \ PROBING_HEATERS_OFF PREHEAT_BEFORE_PROBING diff --git a/buildroot/tests/rumba32 b/buildroot/tests/rumba32 index f26af33610c6..833769d0b9ba 100755 --- a/buildroot/tests/rumba32 +++ b/buildroot/tests/rumba32 @@ -11,7 +11,7 @@ restore_configs opt_set MOTHERBOARD BOARD_RUMBA32_V1_0 SERIAL_PORT -1 \ TEMP_SENSOR_BED 1 X_DRIVER_TYPE TMC2130 opt_disable PIDTEMP -opt_enable PIDTEMPBED +opt_enable PIDTEMPBED FAN_SOFT_PWM opt_disable THERMAL_PROTECTION_BED exec_test $1 $2 "RUMBA32 V1.0 with TMC2130, PID Bed, and bed thermal protection disabled" "$3" @@ -19,12 +19,13 @@ exec_test $1 $2 "RUMBA32 V1.0 with TMC2130, PID Bed, and bed thermal protection restore_configs opt_set MOTHERBOARD BOARD_RUMBA32_V1_1 SERIAL_PORT -1 \ TEMP_SENSOR_BED 1 X_DRIVER_TYPE TMC2130 Y_DRIVER_TYPE TMC2208 -opt_enable PIDTEMPBED EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER +opt_enable PIDTEMPBED FAN_SOFT_PWM EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER exec_test $1 $2 "RUMBA32 V1.1 with TMC2130, TMC2208, PID Bed, EEPROM settings, and graphic LCD controller" "$3" # Build examples restore_configs opt_set MOTHERBOARD BOARD_RUMBA32_MKS SERIAL_PORT -1 X_DRIVER_TYPE TMC2130 Y_DRIVER_TYPE TMC2208 +opt_enable FAN_SOFT_PWM exec_test $1 $2 "RUMBA32 MKS Default Config with Mixed TMC Drivers" "$3" # cleanup diff --git a/buildroot/web-ui/data/www/webmarlin-class.js b/buildroot/web-ui/data/www/webmarlin-class.js index 393fd88eef26..2cfc4cbfba6f 100644 --- a/buildroot/web-ui/data/www/webmarlin-class.js +++ b/buildroot/web-ui/data/www/webmarlin-class.js @@ -349,18 +349,18 @@ class jsLog { var wmGCommands = { CustomCmd : new wmGCommandItem('',null,null,'Custom command'), - MoveFw : new wmGCommandItem('G1','Y{0}',10,'Move forward on Y axis'), - MoveBw : new wmGCommandItem('G1','Y-{0}',10,'Move backward on Y axis'), - MoveSx : new wmGCommandItem('G1','X{0}',10,'Move left on X axis'), - MoveDx : new wmGCommandItem('G1','X-{0}',10,'Move right on X axis'), - MoveUp : new wmGCommandItem('G1','Z{0}',10,'Move up on Z axis'), - MoveDw : new wmGCommandItem('G1','Z-{0}',10,'Move down on Z axis'), + MoveFw : new wmGCommandItem('G1','Y{0}',10,'Move Y forward'), + MoveBw : new wmGCommandItem('G1','Y-{0}',10,'Move Y backward'), + MoveSx : new wmGCommandItem('G1','X{0}',10,'Move X left'), + MoveDx : new wmGCommandItem('G1','X-{0}',10,'Move X right'), + MoveUp : new wmGCommandItem('G1','Z{0}',10,'Move Z up'), + MoveDw : new wmGCommandItem('G1','Z-{0}',10,'Move Z down'), FillRetrive : new wmGCommandItem('G10',null,null,'Retract filament'), FillExtrude : new wmGCommandItem('GYYYY',null,null,'Extrude filament'), - MoveHome : new wmGCommandItem('G28',null,null,'Go home on all axis'), - MoveHomeX : new wmGCommandItem('G28','X',null,'Go home on X axis'), - MoveHomeY : new wmGCommandItem('G28','Y',null,'Go home on Y axis'), - MoveHomeZ : new wmGCommandItem('G28','Z',null,'Go home on Z axis'), + MoveHome : new wmGCommandItem('G28',null,null,'Home all axes'), + MoveHomeX : new wmGCommandItem('G28','X',null,'Home X axis'), + MoveHomeY : new wmGCommandItem('G28','Y',null,'Home Y axis'), + MoveHomeZ : new wmGCommandItem('G28','Z',null,'Home Z axis'), StepEnable : new wmGCommandItem('M17','{0}','E X Y Z','Enable stepper'), StepEnableAll : new wmGCommandItem('M17',null,null,'Enable all steppers'), StepDisable : new wmGCommandItem('M18','{0}','E X Y Z','Disable stepper'),