Quellcode durchsuchen

Minor code cleanup

Scott Lahteine vor 4 Jahren
Ursprung
Commit
514afddeb4

+ 1
- 1
Marlin/src/feature/tmc_util.cpp Datei anzeigen

@@ -1254,7 +1254,7 @@ void test_tmc_connection(const bool test_x, const bool test_y, const bool test_z
1254 1254
     #endif
1255 1255
   }
1256 1256
 
1257
-  if (axis_connection) ui.set_status_P(GET_TEXT(MSG_ERROR_TMC));
1257
+  if (axis_connection) LCD_MESSAGEPGM(MSG_ERROR_TMC);
1258 1258
 }
1259 1259
 
1260 1260
 #endif // HAS_TRINAMIC_CONFIG

+ 1
- 1
Marlin/src/inc/Conditionals_post.h Datei anzeigen

@@ -2164,7 +2164,7 @@
2164 2164
     #define SHARED_SD_CARD
2165 2165
   #endif
2166 2166
   #if DISABLED(SHARED_SD_CARD)
2167
-    #define INIT_SDCARD_ON_BOOT
2167
+    #define INIT_SDCARD_ON_BOOT 1
2168 2168
   #endif
2169 2169
 #endif
2170 2170
 

+ 2
- 2
Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp Datei anzeigen

@@ -367,11 +367,11 @@ void MarlinUI::init_lcd() {
367 367
 }
368 368
 
369 369
 bool MarlinUI::detected() {
370
-  return true
370
+  return (true
371 371
     #if EITHER(LCD_I2C_TYPE_MCP23017, LCD_I2C_TYPE_MCP23008) && defined(DETECT_DEVICE)
372 372
       && lcd.LcdDetected() == 1
373 373
     #endif
374
-  ;
374
+  );
375 375
 }
376 376
 
377 377
 #if HAS_SLOW_BUTTONS

+ 1
- 7
Marlin/src/lcd/dogm/ultralcd_DOGM.cpp Datei anzeigen

@@ -244,13 +244,7 @@ void MarlinUI::init_lcd() {
244 244
   #if DISABLED(MKS_LCD12864B)
245 245
 
246 246
     #if PIN_EXISTS(LCD_BACKLIGHT)
247
-      OUT_WRITE(LCD_BACKLIGHT_PIN, (
248
-        #if ENABLED(DELAYED_BACKLIGHT_INIT)
249
-          LOW  // Illuminate after reset
250
-        #else
251
-          HIGH // Illuminate right away
252
-        #endif
253
-      ));
247
+      OUT_WRITE(LCD_BACKLIGHT_PIN, DISABLED(DELAYED_BACKLIGHT_INIT)); // Illuminate after reset or right away
254 248
     #endif
255 249
 
256 250
     #if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306)

+ 0
- 1
Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.cpp Datei anzeigen

@@ -441,7 +441,6 @@ void DGUSScreenVariableHandler::DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variab
441 441
     DGUSLCD_SendStringToDisplay(var);
442 442
   }
443 443
 
444
-
445 444
   void DGUSScreenVariableHandler::SDCardInserted() {
446 445
     top_file = 0;
447 446
     auto cs = ScreenHandler.getCurrentScreen();

+ 2
- 4
Marlin/src/lcd/ultralcd.cpp Datei anzeigen

@@ -351,10 +351,8 @@ void MarlinUI::init() {
351 351
     #endif
352 352
   #endif
353 353
 
354
-  #if HAS_ENCODER_ACTION
355
-    #if HAS_SLOW_BUTTONS
356
-      slow_buttons = 0;
357
-    #endif
354
+  #if HAS_ENCODER_ACTION && HAS_SLOW_BUTTONS
355
+    slow_buttons = 0;
358 356
   #endif
359 357
 
360 358
   update_buttons();

+ 3
- 3
Marlin/src/module/configuration_store.cpp Datei anzeigen

@@ -1391,7 +1391,7 @@ void MarlinSettings::postprocess() {
1391 1391
       DEBUG_ECHO_START();
1392 1392
       DEBUG_ECHOLNPAIR("EEPROM version mismatch (EEPROM=", stored_ver, " Marlin=" EEPROM_VERSION ")");
1393 1393
       #if HAS_LCD_MENU && DISABLED(EEPROM_AUTO_INIT)
1394
-        ui.set_status_P(GET_TEXT(MSG_ERR_EEPROM_VERSION));
1394
+        LCD_MESSAGEPGM(MSG_ERR_EEPROM_VERSION);
1395 1395
       #endif
1396 1396
       eeprom_error = true;
1397 1397
     }
@@ -2199,7 +2199,7 @@ void MarlinSettings::postprocess() {
2199 2199
         DEBUG_ECHO_START();
2200 2200
         DEBUG_ECHOLNPAIR("Index: ", int(eeprom_index - (EEPROM_OFFSET)), " Size: ", datasize());
2201 2201
         #if HAS_LCD_MENU && DISABLED(EEPROM_AUTO_INIT)
2202
-          ui.set_status_P(GET_TEXT(MSG_ERR_EEPROM_INDEX));
2202
+          LCD_MESSAGEPGM(MSG_ERR_EEPROM_INDEX);
2203 2203
         #endif
2204 2204
       }
2205 2205
       else if (working_crc != stored_crc) {
@@ -2207,7 +2207,7 @@ void MarlinSettings::postprocess() {
2207 2207
         DEBUG_ERROR_START();
2208 2208
         DEBUG_ECHOLNPAIR("EEPROM CRC mismatch - (stored) ", stored_crc, " != ", working_crc, " (calculated)!");
2209 2209
         #if HAS_LCD_MENU && DISABLED(EEPROM_AUTO_INIT)
2210
-          ui.set_status_P(GET_TEXT(MSG_ERR_EEPROM_CRC));
2210
+          LCD_MESSAGEPGM(MSG_ERR_EEPROM_CRC);
2211 2211
         #endif
2212 2212
       }
2213 2213
       else if (!validating) {

+ 7
- 15
Marlin/src/module/temperature.cpp Datei anzeigen

@@ -542,22 +542,14 @@ volatile bool Temperature::raw_temps_ready = false;
542 542
 
543 543
         // Make sure heating is actually working
544 544
         #if WATCH_BED || WATCH_HOTENDS
545
-          if (
546
-            #if WATCH_BED && WATCH_HOTENDS
547
-              true
548
-            #elif WATCH_HOTENDS
549
-              !isbed
550
-            #else
551
-              isbed
552
-            #endif
553
-          ) {
554
-            if (!heated) {                                          // If not yet reached target...
555
-              if (current_temp > next_watch_temp) {                      // Over the watch temp?
556
-                next_watch_temp = current_temp + watch_temp_increase;    // - set the next temp to watch for
557
-                temp_change_ms = ms + watch_temp_period * 1000UL;   // - move the expiration timer up
558
-                if (current_temp > watch_temp_target) heated = true;     // - Flag if target temperature reached
545
+          if (BOTH(WATCH_BED, WATCH_HOTENDS) || isbed == DISABLED(WATCH_HOTENDS)) {
546
+            if (!heated) {                                            // If not yet reached target...
547
+              if (current_temp > next_watch_temp) {                   // Over the watch temp?
548
+                next_watch_temp = current_temp + watch_temp_increase; // - set the next temp to watch for
549
+                temp_change_ms = ms + watch_temp_period * 1000UL;     // - move the expiration timer up
550
+                if (current_temp > watch_temp_target) heated = true;  // - Flag if target temperature reached
559 551
               }
560
-              else if (ELAPSED(ms, temp_change_ms))                 // Watch timer expired
552
+              else if (ELAPSED(ms, temp_change_ms))                   // Watch timer expired
561 553
                 _temp_error(heater, str_t_heating_failed, GET_TEXT(MSG_HEATING_FAILED_LCD));
562 554
             }
563 555
             else if (current_temp < target - (MAX_OVERSHOOT_PID_AUTOTUNE)) // Heated, then temperature fell too far?

Laden…
Abbrechen
Speichern