fix: Enhance UI setup across multiple boards (#1753)
* chore: Update component versions and enhance UI setup across multiple boards - Bumped uart-eth-modem version from ~0.3.2 to ~0.3.3 in idf_component.yml. - Added SetupUI method to various display classes to ensure proper UI initialization before usage. - Improved error handling in display classes to prevent issues when UI is not set up. - Ensured UI customization is performed in SetupUI rather than constructors for better reliability. * remove pm config code
This commit is contained in:
@ -76,6 +76,18 @@ OledDisplay::OledDisplay(esp_lcd_panel_io_handle_t panel_io, esp_lcd_panel_handl
|
||||
return;
|
||||
}
|
||||
|
||||
// Note: SetupUI() should be called by Application::Initialize(), not in constructor
|
||||
// to ensure lvgl objects are created after the display is fully initialized.
|
||||
}
|
||||
|
||||
void OledDisplay::SetupUI() {
|
||||
// Prevent duplicate calls - if already called, return early
|
||||
if (setup_ui_called_) {
|
||||
ESP_LOGW(TAG, "SetupUI() called multiple times, skipping duplicate call");
|
||||
return;
|
||||
}
|
||||
|
||||
Display::SetupUI(); // Mark SetupUI as called
|
||||
if (height_ == 64) {
|
||||
SetupUI_128x64();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user