Browse Source

🎨 Misc. cleanup (from MMU3 PR)

Co-Authored-By: Erkan Ozgur Yilmaz <1786804+eoyilmaz@users.noreply.github.com>
Scott Lahteine 6 months ago
parent
commit
0cd9643957

+ 1 - 0
.gitignore

@@ -125,6 +125,7 @@ vc-fileutils.settings
 # Visual Studio Code
 .vscode/*
 !.vscode/extensions.json
+*.code-workspace
 
 # Simulation files
 imgui.ini

+ 1 - 1
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);
 

+ 2 - 2
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'); }

+ 2 - 2
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 <typename T, typename ... Args>

+ 1 - 1
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

+ 16 - 23
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');

+ 1 - 1
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")

+ 3 - 3
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);

+ 2 - 2
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
 };
 

+ 2 - 2
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
 };
 

Some files were not shown because too many files changed in this diff