diff --git a/.gitignore b/.gitignore index c7d47c607fd1..50a34f97ff81 100755 --- a/.gitignore +++ b/.gitignore @@ -125,6 +125,7 @@ vc-fileutils.settings # Visual Studio Code .vscode/* !.vscode/extensions.json +*.code-workspace # Simulation files imgui.ini diff --git a/Marlin/src/HAL/DUE/Servo.cpp b/Marlin/src/HAL/DUE/Servo.cpp index 2dab88238dd6..2f72d66b9bfc 100644 --- a/Marlin/src/HAL/DUE/Servo.cpp +++ b/Marlin/src/HAL/DUE/Servo.cpp @@ -50,7 +50,7 @@ static Flags<_Nbr_16timers> DisablePending; // ISR should disable the timer at the next timer reset // ------------------------ -/// Interrupt handler for the TC0 channel 1. +// Interrupt handler for the TC0 channel 1. // ------------------------ void Servo_Handler(const timer16_Sequence_t, Tc*, const uint8_t); diff --git a/Marlin/src/core/serial.cpp b/Marlin/src/core/serial.cpp index d6c4b55459de..5373f5efd624 100644 --- a/Marlin/src/core/serial.cpp +++ b/Marlin/src/core/serial.cpp @@ -75,8 +75,8 @@ template <> void SERIAL_ECHO(const p_float_t pf) { SERIAL_IMPL.print(pf.value, p template <> void SERIAL_ECHO(const w_float_t wf) { char f1[20]; SERIAL_IMPL.print(dtostrf(wf.value, wf.width, wf.prec, f1)); } // Specializations for F-string -template <> void SERIAL_ECHO(const FSTR_P fstr) { SERIAL_ECHO_P(FTOP(fstr)); } -template <> void SERIAL_ECHOLN(const FSTR_P fstr) { SERIAL_ECHOLN_P(FTOP(fstr)); } +template <> void SERIAL_ECHO(FSTR_P const fstr) { SERIAL_ECHO_P(FTOP(fstr)); } +template <> void SERIAL_ECHOLN(FSTR_P const fstr) { SERIAL_ECHOLN_P(FTOP(fstr)); } void SERIAL_CHAR(char a) { SERIAL_IMPL.write(a); } void SERIAL_EOL() { SERIAL_CHAR('\n'); } diff --git a/Marlin/src/core/serial.h b/Marlin/src/core/serial.h index 76ef9afb2263..97f31dea35a6 100644 --- a/Marlin/src/core/serial.h +++ b/Marlin/src/core/serial.h @@ -171,8 +171,8 @@ template<> void SERIAL_ECHO(const p_float_t pf); template<> void SERIAL_ECHO(const w_float_t wf); // Specializations for F-string -template<> void SERIAL_ECHO(const FSTR_P fstr); -template<> void SERIAL_ECHOLN(const FSTR_P fstr); +template<> void SERIAL_ECHO(FSTR_P const fstr); +template<> void SERIAL_ECHOLN(FSTR_P const fstr); // Print any number of items with arbitrary types (except loose PROGMEM strings) template diff --git a/Marlin/src/feature/leds/leds.cpp b/Marlin/src/feature/leds/leds.cpp index 8810c518cf70..2f0e5d9292ed 100644 --- a/Marlin/src/feature/leds/leds.cpp +++ b/Marlin/src/feature/leds/leds.cpp @@ -83,7 +83,7 @@ void LEDLights::setup() { if (i == 1 && PWM_PIN(RGB_LED_G_PIN)) hal.set_pwm_duty(pin_t(RGB_LED_G_PIN), led_pwm); else WRITE(RGB_LED_G_PIN, b < 100 ? HIGH : LOW); if (i == 2 && PWM_PIN(RGB_LED_B_PIN)) hal.set_pwm_duty(pin_t(RGB_LED_B_PIN), led_pwm); else WRITE(RGB_LED_B_PIN, b < 100 ? HIGH : LOW); #if ENABLED(RGBW_LED) - if (i == 3){ + if (i == 3) { if (PWM_PIN(RGB_LED_W_PIN)) hal.set_pwm_duty(pin_t(RGB_LED_W_PIN), led_pwm); else WRITE(RGB_LED_W_PIN, b < 100 ? HIGH : LOW); delay(RGB_STARTUP_TEST_INNER_MS);//More slowing for ending diff --git a/Marlin/src/gcode/gcode_d.cpp b/Marlin/src/gcode/gcode_d.cpp index 28edf9dcdb1e..bc0d640b7365 100644 --- a/Marlin/src/gcode/gcode_d.cpp +++ b/Marlin/src/gcode/gcode_d.cpp @@ -99,6 +99,7 @@ void GcodeSuite::D(const int16_t dcode) { } break; #if ENABLED(EEPROM_SETTINGS) + case 3: { // D3 Read / Write EEPROM uint8_t *pointer = parser.hex_adr_val('A'); uint16_t len = parser.ushortval('C', 1); @@ -107,35 +108,27 @@ void GcodeSuite::D(const int16_t dcode) { NOMORE(len, persistentStore.capacity() - addr); if (parser.seenval('X')) { uint16_t val = parser.hex_val('X'); - #if ENABLED(EEPROM_SETTINGS) - persistentStore.access_start(); - while (len--) { - int pos = 0; - persistentStore.write_data(pos, (uint8_t *)&val, sizeof(val)); - } - SERIAL_EOL(); - persistentStore.access_finish(); - #else - SERIAL_ECHOLNPGM("NO EEPROM"); - #endif + persistentStore.access_start(); + while (len--) { + int pos = 0; + persistentStore.write_data(pos, (uint8_t *)&val, sizeof(val)); + } + SERIAL_EOL(); + persistentStore.access_finish(); } else { // Read bytes from EEPROM - #if ENABLED(EEPROM_SETTINGS) - persistentStore.access_start(); - int pos = 0; - uint8_t val; - while (len--) if (!persistentStore.read_data(pos, &val, 1)) print_hex_byte(val); - SERIAL_EOL(); - persistentStore.access_finish(); - #else - SERIAL_ECHOLNPGM("NO EEPROM"); - len = 0; - #endif + persistentStore.access_start(); + int pos = 0; + uint8_t val; + while (len--) if (!persistentStore.read_data(pos, &val, 1)) print_hex_byte(val); + SERIAL_EOL(); + persistentStore.access_finish(); SERIAL_EOL(); } } break; - #endif + + #endif // EEPROM_SETTINGS case 4: { // D4 Read / Write PIN //const bool is_out = parser.boolval('F'); diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 4a4d0a599e62..633f756c8f5d 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -1811,7 +1811,7 @@ void dwinPrintFinished() { // Print was aborted void dwinPrintAborted() { #ifndef EVENT_GCODE_SD_ABORT - if (all_axes_homed()) { + if (ExtUI::isMachineHomed()) { queue.inject( #if ENABLED(NOZZLE_PARK_FEATURE) F("G27") diff --git a/Marlin/src/lcd/extui/dgus/DGUSDisplay.h b/Marlin/src/lcd/extui/dgus/DGUSDisplay.h index d65c30fc16b6..816360d3f3f1 100644 --- a/Marlin/src/lcd/extui/dgus/DGUSDisplay.h +++ b/Marlin/src/lcd/extui/dgus/DGUSDisplay.h @@ -114,11 +114,11 @@ extern DGUSDisplay dgus; // compile-time x^y constexpr float cpow(const float x, const int y) { return y == 0 ? 1.0 : x * cpow(x, y - 1); } -/// +// const uint16_t* findScreenVPMapList(uint8_t screen); -/// Find the flash address of a DGUS_VP_Variable for the VP. +// Find the flash address of a DGUS_VP_Variable for the VP. const DGUS_VP_Variable* findVPVar(const uint16_t vp); -/// Helper to populate a DGUS_VP_Variable for a given VP. Return false if not found. +// Helper to populate a DGUS_VP_Variable for a given VP. Return false if not found. bool populate_VPVar(const uint16_t VP, DGUS_VP_Variable * const ramcopy); diff --git a/Marlin/src/lcd/extui/dgus/fysetc/DGUSDisplayDef.h b/Marlin/src/lcd/extui/dgus/fysetc/DGUSDisplayDef.h index 70559f903196..d8dc81b56647 100644 --- a/Marlin/src/lcd/extui/dgus/fysetc/DGUSDisplayDef.h +++ b/Marlin/src/lcd/extui/dgus/fysetc/DGUSDisplayDef.h @@ -48,9 +48,9 @@ enum DGUS_ScreenID : uint8_t { DGUS_SCREEN_Z_OFFSET = 222, DGUS_SCREEN_INFOS = 36, DGUS_SCREEN_CONFIRM = 240, - DGUS_SCREEN_KILL = 250, ///< Kill Screen. Must always be 250 (to be able to display "Error wrong LCD Version") + DGUS_SCREEN_KILL = 250, //!< Kill Screen. Must always be 250 (to be able to display "Error wrong LCD Version") DGUS_SCREEN_WAITING = 251, - DGUS_SCREEN_POPUP = 252, ///< special target, popup screen will also return this code to say "return to previous screen" + DGUS_SCREEN_POPUP = 252, //!< special target, popup screen will also return this code to say "return to previous screen" DGUS_SCREEN_UNUSED = 255 }; diff --git a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSDisplayDef.h b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSDisplayDef.h index 6270207990a7..3019b6651e6e 100644 --- a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSDisplayDef.h +++ b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSDisplayDef.h @@ -48,9 +48,9 @@ enum DGUS_ScreenID : uint8_t { DGUS_SCREEN_PID_BED = 128, DGUS_SCREEN_INFOS = 131, DGUS_SCREEN_CONFIRM = 240, - DGUS_SCREEN_KILL = 250, ///< Kill Screen. Must always be 250 (to be able to display "Error wrong LCD Version") + DGUS_SCREEN_KILL = 250, //!< Kill Screen. Must always be 250 (to be able to display "Error wrong LCD Version") DGUS_SCREEN_WAITING = 251, - DGUS_SCREEN_POPUP = 252, ///< special target, popup screen will also return this code to say "return to previous screen" + DGUS_SCREEN_POPUP = 252, //!< special target, popup screen will also return this code to say "return to previous screen" DGUS_SCREEN_UNUSED = 255 }; diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.h b/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.h index da2cf96a8725..ee2e7ffb6bbb 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.h +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.h @@ -235,9 +235,9 @@ enum DGUS_ScreenID : uint8_t { #endif DGUS_SCREEN_CONFIRM = 240, - DGUS_SCREEN_KILL = 250, ///< Kill Screen. Must always be 250 (to be able to display "Error wrong LCD Version") + DGUS_SCREEN_KILL = 250, //!< Kill Screen. Must always be 250 (to be able to display "Error wrong LCD Version") DGUS_SCREEN_WAITING = 251, - DGUS_SCREEN_POPUP = 252, ///< special target, popup screen will also return this code to say "return to previous screen" + DGUS_SCREEN_POPUP = 252, //!< special target, popup screen will also return this code to say "return to previous screen" DGUS_SCREEN_UNUSED = 255 }; diff --git a/Marlin/src/lcd/extui/dgus/origin/DGUSDisplayDef.h b/Marlin/src/lcd/extui/dgus/origin/DGUSDisplayDef.h index e601abd25518..136b90e64169 100644 --- a/Marlin/src/lcd/extui/dgus/origin/DGUSDisplayDef.h +++ b/Marlin/src/lcd/extui/dgus/origin/DGUSDisplayDef.h @@ -43,9 +43,9 @@ enum DGUS_ScreenID : uint8_t { DGUS_SCREEN_FILAMENT_UNLOADING = 158, DGUS_SCREEN_SDPRINTTUNE = 170, DGUS_SCREEN_CONFIRM = 240, - DGUS_SCREEN_KILL = 250, ///< Kill Screen. Must always be 250 (to be able to display "Error wrong LCD Version") + DGUS_SCREEN_KILL = 250, //!< Kill Screen. Must always be 250 (to be able to display "Error wrong LCD Version") DGUS_SCREEN_WAITING = 251, - DGUS_SCREEN_POPUP = 252, ///< special target, popup screen will also return this code to say "return to previous screen" + DGUS_SCREEN_POPUP = 252, //!< special target, popup screen will also return this code to say "return to previous screen" DGUS_SCREEN_UNUSED = 255 }; diff --git a/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSDisplay.h b/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSDisplay.h index f635c3191b7d..c1b993ac413c 100644 --- a/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSDisplay.h +++ b/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSDisplay.h @@ -159,5 +159,5 @@ class DGUSDisplay { extern DGUSDisplay dgus; -/// Helper to populate a DGUS_VP for a given VP. Return false if not found. +// Helper to populate a DGUS_VP for a given VP. Return false if not found. extern bool DGUS_PopulateVP(const DGUS_Addr addr, DGUS_VP * const buffer); diff --git a/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.h index 2f8c53f14d0e..073d8f77c0b8 100644 --- a/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.h @@ -117,11 +117,11 @@ class DGUSScreenHandler { #endif #if HAS_MEDIA - /// Marlin informed us that a new SD has been inserted. + // Marlin informed us that a new SD has been inserted. static void sdCardInserted(); - /// Marlin informed us that the SD Card has been removed(). + // Marlin informed us that the SD Card has been removed(). static void sdCardRemoved(); - /// Marlin informed us about a bad SD Card. + // Marlin informed us about a bad SD Card. static void sdCardError(); static const char* getSDCardPrintFilename() { return sdPrintFilename; } diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.h b/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.h index 63830ddee585..4880c44688bb 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.h @@ -178,5 +178,5 @@ template<> inline uint16_t DGUSDisplay::swapBytes(const uint16_t value) { extern DGUSDisplay dgus; -/// Helper to populate a DGUS_VP for a given VP. Return false if not found. +// Helper to populate a DGUS_VP for a given VP. Return false if not found. extern bool populateVP(const DGUS_Addr addr, DGUS_VP * const buffer); diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h index d233ed6fe332..ec7ebc5bed9f 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h @@ -53,11 +53,11 @@ class DGUSScreenHandler { static void filamentRunout(const ExtUI::extruder_t extruder); #if HAS_MEDIA - /// Marlin informed us that a new SD has been inserted. + // Marlin informed us that a new SD has been inserted. static void sdCardInserted(); - /// Marlin informed us that the SD Card has been removed(). + // Marlin informed us that the SD Card has been removed(). static void sdCardRemoved(); - /// Marlin informed us about a bad SD Card. + // Marlin informed us about a bad SD Card. static void sdCardError(); #endif diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/status_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/status_screen.cpp index b273ac7dde4b..1a7ccd8be5e6 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/status_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/status_screen.cpp @@ -116,7 +116,7 @@ void StatusScreen::send_buffer(CommandProcessor &cmd, const void *data, uint16_t memcpy_P(block, ptr, nBytes); cmd.write((const void*)block, nBytes); cmd.execute(); - if(cmd.has_fault()) { + if (cmd.has_fault()) { SERIAL_ECHOLNPGM("Recovering from fault: "); cmd.reset(); delay(1000); diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index 15cfeac91118..bb38922d7e34 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -161,12 +161,14 @@ typedef struct { float p, i, d, c, f; } raw_pidcf_t; #define scalePID_d(d) ( float(d) / PID_dT ) #define unscalePID_d(d) ( float(d) * PID_dT ) - /// @brief The default PID class, only has Kp, Ki, Kd, other classes extend this one - /// @tparam MIN_POW output when current is above target by functional_range - /// @tparam MAX_POW output when current is below target by functional_range - /// @details This class has methods for Kc and Kf terms, but returns constant default values - /// PID classes that implement these features are expected to override these methods - /// Since the finally used PID class is typedef-d, there is no need to use virtual functions + /** + * @brief The default PID class, only has Kp, Ki, Kd, other classes extend this one + * @tparam MIN_POW output when current is above target by functional_range + * @tparam MAX_POW output when current is below target by functional_range + * @details This class has methods for Kc and Kf terms, but returns constant default values. + * PID classes that implement these features are expected to override these methods. + * Since the eventual PID class is typedef-d, there is no need to use virtual functions. + */ template struct PID_t { protected: @@ -241,7 +243,7 @@ typedef struct { float p, i, d, c, f; } raw_pidcf_t; #if ENABLED(PIDTEMP) - /// @brief Extrusion scaled PID class + // @brief Extrusion scaled PID class template struct PIDC_t : public PID_t { private: @@ -293,11 +295,11 @@ typedef struct { float p, i, d, c, f; } raw_pidcf_t; } }; - /// @brief Fan scaled PID, this class implements the get_fan_scale_output() method - /// @tparam MIN_POW @see PID_t - /// @tparam MAX_POW @see PID_t - /// @tparam SCALE_MIN_SPEED parameter from Configuration_adv.h - /// @tparam SCALE_LIN_FACTOR parameter from Configuration_adv.h + // @brief Fan scaled PID, this class implements the get_fan_scale_output() method + // @tparam MIN_POW @see PID_t + // @tparam MAX_POW @see PID_t + // @tparam SCALE_MIN_SPEED parameter from Configuration_adv.h + // @tparam SCALE_LIN_FACTOR parameter from Configuration_adv.h template struct PIDF_t : public PID_t { private: @@ -327,7 +329,7 @@ typedef struct { float p, i, d, c, f; } raw_pidcf_t; } }; - /// @brief Inherits PID and PIDC - can't use proper diamond inheritance w/o virtual + // @brief Inherits PID and PIDC - can't use proper diamond inheritance w/o virtual template struct PIDCF_t : public PIDC_t { private: diff --git a/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant.h index 3b4d43054ddf..c825a6b13dc6 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant.h @@ -86,7 +86,7 @@ extern "C" { #define PH1 50 // | 50 | | | | | | OSC_OUT | // |---------|------------|------------|-----------------------|----------------------|-----------------------------------|-----------| -/// This must be a literal +// This must be a literal #define NUM_DIGITAL_PINS 51 #define NUM_ANALOG_INPUTS 16