|
@@ -77,6 +77,7 @@ WebServer httpServer(80);
|
|
|
#include "index_html.h"
|
|
#include "index_html.h"
|
|
|
|
|
|
|
|
hd44780_I2Cexp lcd;
|
|
hd44780_I2Cexp lcd;
|
|
|
|
|
+static bool s_lcdOk = false;
|
|
|
|
|
|
|
|
//=============================================================
|
|
//=============================================================
|
|
|
// NeoPixel status LED (Waveshare ESP32-S3 Zero, GPIO 21)
|
|
// NeoPixel status LED (Waveshare ESP32-S3 Zero, GPIO 21)
|
|
@@ -320,8 +321,10 @@ static void printWifiInfo()
|
|
|
Serial.print("MAC: "); Serial.println(WiFi.macAddress());
|
|
Serial.print("MAC: "); Serial.println(WiFi.macAddress());
|
|
|
Serial.println("Modulos AudioDSP");
|
|
Serial.println("Modulos AudioDSP");
|
|
|
Serial.println(version);
|
|
Serial.println(version);
|
|
|
- lcd.setCursor(4, 3);
|
|
|
|
|
- lcd.print(WiFi.localIP());
|
|
|
|
|
|
|
+ if (s_lcdOk) {
|
|
|
|
|
+ lcd.setCursor(4, 3);
|
|
|
|
|
+ lcd.print(WiFi.localIP());
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//=============================================================
|
|
//=============================================================
|
|
@@ -450,9 +453,14 @@ void setup() {
|
|
|
statusLed.setBrightness(NEOPIXEL_BRIGHT);
|
|
statusLed.setBrightness(NEOPIXEL_BRIGHT);
|
|
|
statusLed.show();
|
|
statusLed.show();
|
|
|
|
|
|
|
|
- lcd.begin(20, 4); lcd.display(); lcd.backlight();
|
|
|
|
|
- lcd.setCursor(2, 0); lcd.print("Modulos AudioDSP"); delay(1000);
|
|
|
|
|
- lcd.setCursor(5, 1); lcd.print("Booting..."); delay(1000);
|
|
|
|
|
|
|
+ s_lcdOk = (lcd.begin(20, 4) == 0);
|
|
|
|
|
+ if (s_lcdOk) {
|
|
|
|
|
+ lcd.display(); lcd.backlight();
|
|
|
|
|
+ lcd.setCursor(2, 0); lcd.print("Modulos AudioDSP"); delay(1000);
|
|
|
|
|
+ lcd.setCursor(5, 1); lcd.print("Booting..."); delay(1000);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ Serial.println("LCD not found - continuing without display");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
Serial.begin(115200); delay(1500);
|
|
Serial.begin(115200); delay(1500);
|
|
|
Serial.println(); Serial.println("Booting...");
|
|
Serial.println(); Serial.println("Booting...");
|
|
@@ -474,7 +482,7 @@ void setup() {
|
|
|
File root = LittleFS.open("/"); File f = root.openNextFile();
|
|
File root = LittleFS.open("/"); File f = root.openNextFile();
|
|
|
while (f) { Serial.print("LittleFS: "); Serial.println(f.name()); f = root.openNextFile(); }
|
|
while (f) { Serial.print("LittleFS: "); Serial.println(f.name()); f = root.openNextFile(); }
|
|
|
|
|
|
|
|
- lcd.setCursor(3, 2); lcd.print("File System OK"); delay(1000);
|
|
|
|
|
|
|
+ if (s_lcdOk) { lcd.setCursor(3, 2); lcd.print("File System OK"); delay(1000); }
|
|
|
|
|
|
|
|
tcpServer.begin();
|
|
tcpServer.begin();
|
|
|
httpServer.on("/", HTTP_GET, handleRoot);
|
|
httpServer.on("/", HTTP_GET, handleRoot);
|
|
@@ -488,10 +496,12 @@ void setup() {
|
|
|
});
|
|
});
|
|
|
httpServer.begin();
|
|
httpServer.begin();
|
|
|
|
|
|
|
|
- lcd.setCursor(4, 3); lcd.print("System Ready"); delay(1000);
|
|
|
|
|
- lcd.clear();
|
|
|
|
|
- lcd.setCursor(2, 0); lcd.print("Modulos AudioDSP");
|
|
|
|
|
- lcd.setCursor(3, 1); lcd.print(version); delay(500);
|
|
|
|
|
|
|
+ if (s_lcdOk) {
|
|
|
|
|
+ lcd.setCursor(4, 3); lcd.print("System Ready"); delay(1000);
|
|
|
|
|
+ lcd.clear();
|
|
|
|
|
+ lcd.setCursor(2, 0); lcd.print("Modulos AudioDSP");
|
|
|
|
|
+ lcd.setCursor(3, 1); lcd.print(version); delay(500);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
printWifiInfo();
|
|
printWifiInfo();
|
|
|
Serial.print("HTTP uploader: http://"); Serial.print(WiFi.localIP()); Serial.println("/");
|
|
Serial.print("HTTP uploader: http://"); Serial.print(WiFi.localIP()); Serial.println("/");
|
|
@@ -713,7 +723,7 @@ static void maintainWifi()
|
|
|
if (WiFi.status() != WL_CONNECTED) {
|
|
if (WiFi.status() != WL_CONNECTED) {
|
|
|
if (!s_wifiLost) {
|
|
if (!s_wifiLost) {
|
|
|
Serial.println("WiFi lost");
|
|
Serial.println("WiFi lost");
|
|
|
- lcd.setCursor(0, 3); lcd.print("WiFi lost... ");
|
|
|
|
|
|
|
+ if (s_lcdOk) { lcd.setCursor(0, 3); lcd.print("WiFi lost... "); }
|
|
|
s_wifiLost = true;
|
|
s_wifiLost = true;
|
|
|
}
|
|
}
|
|
|
WiFi.reconnect();
|
|
WiFi.reconnect();
|