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
}
if (axis_connection) ui.set_status_P(GET_TEXT(MSG_ERROR_TMC));
if (axis_connection) LCD_MESSAGEPGM(MSG_ERROR_TMC);
}
#endif // HAS_TRINAMIC_CONFIG

View File

@ -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

View File

@ -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

View File

@ -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)

View File

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

View File

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

View File

@ -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) {

View File

@ -542,22 +542,14 @@ 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 (!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
temp_change_ms = ms + watch_temp_period * 1000UL; // - move the expiration timer up
if (current_temp > watch_temp_target) heated = true; // - Flag if target temperature reached
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
temp_change_ms = ms + watch_temp_period * 1000UL; // - move the expiration timer up
if (current_temp > watch_temp_target) heated = true; // - Flag if target temperature reached
}
else if (ELAPSED(ms, temp_change_ms)) // Watch timer expired
else if (ELAPSED(ms, temp_change_ms)) // Watch timer expired
_temp_error(heater, str_t_heating_failed, GET_TEXT(MSG_HEATING_FAILED_LCD));
}
else if (current_temp < target - (MAX_OVERSHOOT_PID_AUTOTUNE)) // Heated, then temperature fell too far?