Browse Source

Minor code cleanup

vanilla_fb_2.0.x
Scott Lahteine 5 years ago
parent
commit
514afddeb4
  1. 2
      Marlin/src/feature/tmc_util.cpp
  2. 2
      Marlin/src/inc/Conditionals_post.h
  3. 4
      Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp
  4. 8
      Marlin/src/lcd/dogm/ultralcd_DOGM.cpp
  5. 1
      Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.cpp
  6. 4
      Marlin/src/lcd/ultralcd.cpp
  7. 6
      Marlin/src/module/configuration_store.cpp
  8. 10
      Marlin/src/module/temperature.cpp

2
Marlin/src/feature/tmc_util.cpp

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

2
Marlin/src/inc/Conditionals_post.h

@ -2164,7 +2164,7 @@
#define SHARED_SD_CARD
#endif
#if DISABLED(SHARED_SD_CARD)
#define INIT_SDCARD_ON_BOOT
#define INIT_SDCARD_ON_BOOT 1
#endif
#endif

4
Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp

@ -367,11 +367,11 @@ void MarlinUI::init_lcd() {
}
bool MarlinUI::detected() {
return true
return (true
#if EITHER(LCD_I2C_TYPE_MCP23017, LCD_I2C_TYPE_MCP23008) && defined(DETECT_DEVICE)
&& lcd.LcdDetected() == 1
#endif
;
);
}
#if HAS_SLOW_BUTTONS

8
Marlin/src/lcd/dogm/ultralcd_DOGM.cpp

@ -244,13 +244,7 @@ void MarlinUI::init_lcd() {
#if DISABLED(MKS_LCD12864B)
#if PIN_EXISTS(LCD_BACKLIGHT)
OUT_WRITE(LCD_BACKLIGHT_PIN, (
#if ENABLED(DELAYED_BACKLIGHT_INIT)
LOW // Illuminate after reset
#else
HIGH // Illuminate right away
#endif
));
OUT_WRITE(LCD_BACKLIGHT_PIN, DISABLED(DELAYED_BACKLIGHT_INIT)); // Illuminate after reset or right away
#endif
#if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306)

1
Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.cpp

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

4
Marlin/src/lcd/ultralcd.cpp

@ -351,11 +351,9 @@ void MarlinUI::init() {
#endif
#endif
#if HAS_ENCODER_ACTION
#if HAS_SLOW_BUTTONS
#if HAS_ENCODER_ACTION && HAS_SLOW_BUTTONS
slow_buttons = 0;
#endif
#endif
update_buttons();

6
Marlin/src/module/configuration_store.cpp

@ -1391,7 +1391,7 @@ void MarlinSettings::postprocess() {
DEBUG_ECHO_START();
DEBUG_ECHOLNPAIR("EEPROM version mismatch (EEPROM=", stored_ver, " Marlin=" EEPROM_VERSION ")");
#if HAS_LCD_MENU && DISABLED(EEPROM_AUTO_INIT)
ui.set_status_P(GET_TEXT(MSG_ERR_EEPROM_VERSION));
LCD_MESSAGEPGM(MSG_ERR_EEPROM_VERSION);
#endif
eeprom_error = true;
}
@ -2199,7 +2199,7 @@ void MarlinSettings::postprocess() {
DEBUG_ECHO_START();
DEBUG_ECHOLNPAIR("Index: ", int(eeprom_index - (EEPROM_OFFSET)), " Size: ", datasize());
#if HAS_LCD_MENU && DISABLED(EEPROM_AUTO_INIT)
ui.set_status_P(GET_TEXT(MSG_ERR_EEPROM_INDEX));
LCD_MESSAGEPGM(MSG_ERR_EEPROM_INDEX);
#endif
}
else if (working_crc != stored_crc) {
@ -2207,7 +2207,7 @@ void MarlinSettings::postprocess() {
DEBUG_ERROR_START();
DEBUG_ECHOLNPAIR("EEPROM CRC mismatch - (stored) ", stored_crc, " != ", working_crc, " (calculated)!");
#if HAS_LCD_MENU && DISABLED(EEPROM_AUTO_INIT)
ui.set_status_P(GET_TEXT(MSG_ERR_EEPROM_CRC));
LCD_MESSAGEPGM(MSG_ERR_EEPROM_CRC);
#endif
}
else if (!validating) {

10
Marlin/src/module/temperature.cpp

@ -542,15 +542,7 @@ volatile bool Temperature::raw_temps_ready = false;
// Make sure heating is actually working
#if WATCH_BED || WATCH_HOTENDS
if (
#if WATCH_BED && WATCH_HOTENDS
true
#elif WATCH_HOTENDS
!isbed
#else
isbed
#endif
) {
if (BOTH(WATCH_BED, WATCH_HOTENDS) || isbed == DISABLED(WATCH_HOTENDS)) {
if (!heated) { // If not yet reached target...
if (current_temp > next_watch_temp) { // Over the watch temp?
next_watch_temp = current_temp + watch_temp_increase; // - set the next temp to watch for

Loading…
Cancel
Save