Browse Source

Merge pull request #3519 from wavexx/xflash_errors

Correctly show XFLASH initialization errors
3d-gussner 2 years ago
parent
commit
96b9048229
1 changed files with 6 additions and 12 deletions
  1. 6 12
      Firmware/Marlin_main.cpp

+ 6 - 12
Firmware/Marlin_main.cpp

@@ -1048,8 +1048,8 @@ static void fw_crash_init()
 
 static void xflash_err_msg()
 {
-	lcd_clear();
-	lcd_puts_P(_n("External SPI flash\nXFLASH is not res-\nponding. Language\nswitch unavailable."));
+    puts_P(_n("XFLASH not responding."));
+    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.
@@ -1085,10 +1085,6 @@ void setup()
         update_sec_lang_from_external_flash();
 #endif //(LANG_MODE != 0)
 	}
-	else
-	{
-	    xflash_err_msg();
-	}
 #else
 	const bool xflash_success = true;
 #endif //XFLASH
@@ -1321,12 +1317,6 @@ void setup()
 
 	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
 	SERIAL_ECHORPGM(_n("Extruder fan type: "));
 	if (extruder_altfan_detect())
@@ -1421,6 +1411,10 @@ void setup()
     clamp_to_software_endstops(current_position);
     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
 	fsensor_init();
 #endif //FILAMENT_SENSOR