@@ -356,9 +356,8 @@ void setup()
356356 serialSplash ();
357357 // We call this a second time to get the MAC on the screen
358358 clearLCD ();
359- splashLCD ();
360359
361- // Set LED pins as outputs
360+ // Set LED pins as outputs
362361#if defined(LED_D9)
363362 pinMode (LED_D9, OUTPUT);
364363#endif
@@ -382,7 +381,8 @@ void setup()
382381 // Setup and present LCD splash screen
383382 // Setup the SWITCH_MUTE
384383 // Setup the SWITCH_ENCODER
385- GPAD_HAL_setup (&Serial);
384+ IPAddress deviceAddress = wifiManager.getAddress ();
385+ GPAD_HAL_setup (&Serial, wifiManager.getMode (), deviceAddress);
386386
387387#if (DEBUG > 0)
388388 Serial.println (" MAC: " );
@@ -457,10 +457,22 @@ void setup()
457457 {
458458 reconnect ();
459459 }
460+
461+ clearLCD ();
462+ IPAddress currentAddress = wifiManager.getAddress ();
463+ splashLCD (wifiManager.getMode (), currentAddress);
460464 };
461465 wifiManager.setConnectedCallback (connectedCallback);
462466#endif
463467
468+ auto apStartedCallback = [&]()
469+ {
470+ clearLCD ();
471+ IPAddress currentAddress = wifiManager.getAddress ();
472+ splashLCD (wifiManager.getMode (), currentAddress);
473+ };
474+ wifiManager.setApStartedCallback (apStartedCallback);
475+
464476 wifiManager.connect (setupSsid);
465477 WifiOTA::initLittleFS ();
466478 server.begin (); // Start server web socket to render pages
@@ -473,7 +485,7 @@ void setup()
473485 digitalWrite (LED_BUILTIN, LOW); // turn the LED off at end of setup
474486
475487 initRotator ();
476- splashLCD ();
488+ splashLCD (wifiManager. getMode (), deviceAddress );
477489
478490 setupDFPlayer ();
479491 setup_GPAD_menu ();
0 commit comments