fix(P4): Panel-Bringup meldet Fehler im Klartext statt abzustürzen (1.6.2)
Ein fehlgeschlagener Panel-Aufbau endete bisher in einem ESP_ERROR_CHECK tief im LVGL-Port und damit in einem Speicherauszug ohne erkennbare Ursache. - Die Schritte des Waveshare-Bringups melden ihren Fehler über esp_rom_printf, also auch bei Core-Debug-Level "none". Zusätzlich werden PSRAM-Größe, freier PSRAM, größter freier Block und der Framebuffer-Bedarf ausgegeben. - jc_board_bringup() liefert jetzt einen Status. Kommt das Panel nicht hoch, bleibt die Firmware ohne Anzeige lauffähig (UART + OTA), statt beim ersten LVGL-Zugriff erneut abzustürzen. - ui.cpp: alle öffentlichen Funktionen prüfen, ob ui_init gelaufen ist. - Fehlerbehebung: esp_lcd_touch_new_i2c_gt911 setzt im Fehlerfall einen bereits freigegebenen Zeiger. Das Handle wird vorbelegt und der Rückgabewert geprüft. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018QoLDQeUh1dCQz7yYZVb4Y
This commit is contained in:
co-authored by
Claude Opus 5
parent
146420a0bc
commit
d75708993a
@@ -28,16 +28,22 @@ static ProtocolClient* g_client = nullptr;
|
||||
// ECHTE HARDWARE - Bringup in board_bringup.c, LVGL-Mutex im Hersteller-Port.
|
||||
// =====================================================================================
|
||||
extern "C" {
|
||||
void jc_board_bringup(void); // board_bringup.c
|
||||
bool jc_board_bringup(void); // board_bringup.c
|
||||
void jc_backlight_set(int percent); // board_bringup.c
|
||||
bool lvgl_port_lock(int timeout_ms); // lvgl_port_v9.c (Vendor-BSP)
|
||||
void lvgl_port_unlock(void); // lvgl_port_v9.c (Vendor-BSP)
|
||||
}
|
||||
|
||||
// Kam das Panel nicht hoch, laeuft die Firmware ohne Anzeige weiter: UART-Client und
|
||||
// OTA bleiben erreichbar, damit die S3 neu flashen kann. Jeder LVGL-Zugriff wuerde sonst
|
||||
// einen Folgeabsturz ausloesen, der die eigentliche Ursache im Log ueberdeckt.
|
||||
static bool s_panel_ready = false;
|
||||
|
||||
void hal_init(ProtocolClient* client) {
|
||||
g_client = client;
|
||||
jc_board_bringup(); // Panel + Touch + LVGL-Port (eigener Task)
|
||||
s_panel_ready = jc_board_bringup(); // Panel + Touch + LVGL-Port (eigener Task)
|
||||
jc_backlight_set(100);
|
||||
if (!s_panel_ready) return;
|
||||
if (lvgl_port_lock(-1)) { // UI im LVGL-Kontext aufbauen
|
||||
ui_init(g_client);
|
||||
lvgl_port_unlock();
|
||||
@@ -45,8 +51,8 @@ void hal_init(ProtocolClient* client) {
|
||||
}
|
||||
|
||||
void hal_loop() { /* LVGL laeuft im Port-Task - hier nichts zu tun. */ }
|
||||
void hal_lock() { lvgl_port_lock(-1); }
|
||||
void hal_unlock(){ lvgl_port_unlock(); }
|
||||
void hal_lock() { if (s_panel_ready) lvgl_port_lock(-1); }
|
||||
void hal_unlock(){ if (s_panel_ready) lvgl_port_unlock(); }
|
||||
void hal_backlight(int percent) { jc_backlight_set(percent); }
|
||||
|
||||
// =====================================================================================
|
||||
|
||||
Reference in New Issue
Block a user