Browse Source

Minor code cleanup

Scott Lahteine 5 years ago
parent
commit
514afddeb4

+ 1
- 1
Marlin/src/feature/tmc_util.cpp View File

1254
     #endif
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
 #endif // HAS_TRINAMIC_CONFIG
1260
 #endif // HAS_TRINAMIC_CONFIG

+ 1
- 1
Marlin/src/inc/Conditionals_post.h View File

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

+ 2
- 2
Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp View File

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

+ 1
- 7
Marlin/src/lcd/dogm/ultralcd_DOGM.cpp View File

244
   #if DISABLED(MKS_LCD12864B)
244
   #if DISABLED(MKS_LCD12864B)
245
 
245
 
246
     #if PIN_EXISTS(LCD_BACKLIGHT)
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
     #endif
248
     #endif
255
 
249
 
256
     #if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306)
250
     #if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306)

+ 0
- 1
Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.cpp View File

441
     DGUSLCD_SendStringToDisplay(var);
441
     DGUSLCD_SendStringToDisplay(var);
442
   }
442
   }
443
 
443
 
444
-
445
   void DGUSScreenVariableHandler::SDCardInserted() {
444
   void DGUSScreenVariableHandler::SDCardInserted() {
446
     top_file = 0;
445
     top_file = 0;
447
     auto cs = ScreenHandler.getCurrentScreen();
446
     auto cs = ScreenHandler.getCurrentScreen();

+ 2
- 4
Marlin/src/lcd/ultralcd.cpp View File

351
     #endif
351
     #endif
352
   #endif
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
   #endif
356
   #endif
359
 
357
 
360
   update_buttons();
358
   update_buttons();

+ 3
- 3
Marlin/src/module/configuration_store.cpp View File

1391
       DEBUG_ECHO_START();
1391
       DEBUG_ECHO_START();
1392
       DEBUG_ECHOLNPAIR("EEPROM version mismatch (EEPROM=", stored_ver, " Marlin=" EEPROM_VERSION ")");
1392
       DEBUG_ECHOLNPAIR("EEPROM version mismatch (EEPROM=", stored_ver, " Marlin=" EEPROM_VERSION ")");
1393
       #if HAS_LCD_MENU && DISABLED(EEPROM_AUTO_INIT)
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
       #endif
1395
       #endif
1396
       eeprom_error = true;
1396
       eeprom_error = true;
1397
     }
1397
     }
2199
         DEBUG_ECHO_START();
2199
         DEBUG_ECHO_START();
2200
         DEBUG_ECHOLNPAIR("Index: ", int(eeprom_index - (EEPROM_OFFSET)), " Size: ", datasize());
2200
         DEBUG_ECHOLNPAIR("Index: ", int(eeprom_index - (EEPROM_OFFSET)), " Size: ", datasize());
2201
         #if HAS_LCD_MENU && DISABLED(EEPROM_AUTO_INIT)
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
         #endif
2203
         #endif
2204
       }
2204
       }
2205
       else if (working_crc != stored_crc) {
2205
       else if (working_crc != stored_crc) {
2207
         DEBUG_ERROR_START();
2207
         DEBUG_ERROR_START();
2208
         DEBUG_ECHOLNPAIR("EEPROM CRC mismatch - (stored) ", stored_crc, " != ", working_crc, " (calculated)!");
2208
         DEBUG_ECHOLNPAIR("EEPROM CRC mismatch - (stored) ", stored_crc, " != ", working_crc, " (calculated)!");
2209
         #if HAS_LCD_MENU && DISABLED(EEPROM_AUTO_INIT)
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
         #endif
2211
         #endif
2212
       }
2212
       }
2213
       else if (!validating) {
2213
       else if (!validating) {

+ 7
- 15
Marlin/src/module/temperature.cpp View File

542
 
542
 
543
         // Make sure heating is actually working
543
         // Make sure heating is actually working
544
         #if WATCH_BED || WATCH_HOTENDS
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
                 _temp_error(heater, str_t_heating_failed, GET_TEXT(MSG_HEATING_FAILED_LCD));
553
                 _temp_error(heater, str_t_heating_failed, GET_TEXT(MSG_HEATING_FAILED_LCD));
562
             }
554
             }
563
             else if (current_temp < target - (MAX_OVERSHOOT_PID_AUTOTUNE)) // Heated, then temperature fell too far?
555
             else if (current_temp < target - (MAX_OVERSHOOT_PID_AUTOTUNE)) // Heated, then temperature fell too far?

Loading…
Cancel
Save