Correctly show XFLASH initialization errors

Remove the first serial message, which cannot be displayed since serial
is not available yet.

Move both the serial message and display after
serial/temperature/planner is setup, so that we can use
lcd_show_fullscreen_message_and_wait_P properly.
This commit is contained in:
Yuri D'Elia 2022-05-15 18:57:53 +02:00
parent f3adb781a1
commit af9daecf5b

View File

@ -1048,8 +1048,8 @@ static void fw_crash_init()
static void xflash_err_msg() static void xflash_err_msg()
{ {
lcd_clear(); puts_P(_n("XFLASH not responding."));
lcd_puts_P(_n("External SPI flash\nXFLASH is not res-\nponding. Language\nswitch unavailable.")); lcd_show_fullscreen_message_and_wait_P(_n("External SPI flash\nXFLASH is not res-\nponding. Language\nswitch unavailable."));
} }
// "Setup" function is called by the Arduino framework on startup. // "Setup" function is called by the Arduino framework on startup.
@ -1085,10 +1085,6 @@ void setup()
update_sec_lang_from_external_flash(); update_sec_lang_from_external_flash();
#endif //(LANG_MODE != 0) #endif //(LANG_MODE != 0)
} }
else
{
xflash_err_msg();
}
#else #else
const bool xflash_success = true; const bool xflash_success = true;
#endif //XFLASH #endif //XFLASH
@ -1321,12 +1317,6 @@ void setup()
tp_init(); // Initialize temperature loop tp_init(); // Initialize temperature loop
if (xflash_success) lcd_splash(); // we need to do this again, because tp_init() kills lcd
else
{
xflash_err_msg();
puts_P(_n("XFLASH not responding."));
}
#ifdef EXTRUDER_ALTFAN_DETECT #ifdef EXTRUDER_ALTFAN_DETECT
SERIAL_ECHORPGM(_n("Extruder fan type: ")); SERIAL_ECHORPGM(_n("Extruder fan type: "));
if (extruder_altfan_detect()) if (extruder_altfan_detect())
@ -1421,6 +1411,10 @@ void setup()
clamp_to_software_endstops(current_position); clamp_to_software_endstops(current_position);
plan_set_position_curposXYZE(); plan_set_position_curposXYZE();
// Show the xflash error message now that serial, lcd and encoder are available
if (!xflash_success)
xflash_err_msg();
#ifdef FILAMENT_SENSOR #ifdef FILAMENT_SENSOR
fsensor_init(); fsensor_init();
#endif //FILAMENT_SENSOR #endif //FILAMENT_SENSOR