Skip to content

Commit af9daec

Browse files
committed
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.
1 parent f3adb78 commit af9daec

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

Firmware/Marlin_main.cpp

+6-12
Original file line numberDiff line numberDiff line change
@@ -1048,8 +1048,8 @@ static void fw_crash_init()
10481048

10491049
static void xflash_err_msg()
10501050
{
1051-
lcd_clear();
1052-
lcd_puts_P(_n("External SPI flash\nXFLASH is not res-\nponding. Language\nswitch unavailable."));
1051+
puts_P(_n("XFLASH not responding."));
1052+
lcd_show_fullscreen_message_and_wait_P(_n("External SPI flash\nXFLASH is not res-\nponding. Language\nswitch unavailable."));
10531053
}
10541054

10551055
// "Setup" function is called by the Arduino framework on startup.
@@ -1085,10 +1085,6 @@ void setup()
10851085
update_sec_lang_from_external_flash();
10861086
#endif //(LANG_MODE != 0)
10871087
}
1088-
else
1089-
{
1090-
xflash_err_msg();
1091-
}
10921088
#else
10931089
const bool xflash_success = true;
10941090
#endif //XFLASH
@@ -1321,12 +1317,6 @@ void setup()
13211317

13221318
tp_init(); // Initialize temperature loop
13231319

1324-
if (xflash_success) lcd_splash(); // we need to do this again, because tp_init() kills lcd
1325-
else
1326-
{
1327-
xflash_err_msg();
1328-
puts_P(_n("XFLASH not responding."));
1329-
}
13301320
#ifdef EXTRUDER_ALTFAN_DETECT
13311321
SERIAL_ECHORPGM(_n("Extruder fan type: "));
13321322
if (extruder_altfan_detect())
@@ -1421,6 +1411,10 @@ void setup()
14211411
clamp_to_software_endstops(current_position);
14221412
plan_set_position_curposXYZE();
14231413

1414+
// Show the xflash error message now that serial, lcd and encoder are available
1415+
if (!xflash_success)
1416+
xflash_err_msg();
1417+
14241418
#ifdef FILAMENT_SENSOR
14251419
fsensor_init();
14261420
#endif //FILAMENT_SENSOR

0 commit comments

Comments
 (0)