Minor code cleanup

This commit is contained in:
Scott Lahteine 2020-04-01 18:53:58 -05:00
parent 7f5dc7b919
commit 514afddeb4
8 changed files with 17 additions and 34 deletions

View file

@ -1254,7 +1254,7 @@ void test_tmc_connection(const bool test_x, const bool test_y, const bool test_z
#endif #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 #endif // HAS_TRINAMIC_CONFIG

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1391,7 +1391,7 @@ void MarlinSettings::postprocess() {
DEBUG_ECHO_START(); DEBUG_ECHO_START();
DEBUG_ECHOLNPAIR("EEPROM version mismatch (EEPROM=", stored_ver, " Marlin=" EEPROM_VERSION ")"); DEBUG_ECHOLNPAIR("EEPROM version mismatch (EEPROM=", stored_ver, " Marlin=" EEPROM_VERSION ")");
#if HAS_LCD_MENU && DISABLED(EEPROM_AUTO_INIT) #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 #endif
eeprom_error = true; eeprom_error = true;
} }
@ -2199,7 +2199,7 @@ void MarlinSettings::postprocess() {
DEBUG_ECHO_START(); DEBUG_ECHO_START();
DEBUG_ECHOLNPAIR("Index: ", int(eeprom_index - (EEPROM_OFFSET)), " Size: ", datasize()); DEBUG_ECHOLNPAIR("Index: ", int(eeprom_index - (EEPROM_OFFSET)), " Size: ", datasize());
#if HAS_LCD_MENU && DISABLED(EEPROM_AUTO_INIT) #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 #endif
} }
else if (working_crc != stored_crc) { else if (working_crc != stored_crc) {
@ -2207,7 +2207,7 @@ void MarlinSettings::postprocess() {
DEBUG_ERROR_START(); DEBUG_ERROR_START();
DEBUG_ECHOLNPAIR("EEPROM CRC mismatch - (stored) ", stored_crc, " != ", working_crc, " (calculated)!"); DEBUG_ECHOLNPAIR("EEPROM CRC mismatch - (stored) ", stored_crc, " != ", working_crc, " (calculated)!");
#if HAS_LCD_MENU && DISABLED(EEPROM_AUTO_INIT) #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 #endif
} }
else if (!validating) { else if (!validating) {

View file

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