Add persistent OLED UI settings and recovery
This commit is contained in:
+18
-2
@@ -7,6 +7,8 @@
|
||||
#include "network_console.h"
|
||||
#include "local_display.h"
|
||||
#include "local_status_ui.h"
|
||||
#include "local_ui_config.h"
|
||||
#include "local_ui_console.h"
|
||||
#include "local_ui_hw_test.h"
|
||||
#include "rs232_hw_test.h"
|
||||
#include "rs232_port_owner.h"
|
||||
@@ -38,7 +40,7 @@ static const char *TAG = "firmware";
|
||||
|
||||
void app_main(void)
|
||||
{
|
||||
ESP_LOGI(TAG, "ESP32-S3 Serial Swiss Army Knife Phase 7D local controls started");
|
||||
ESP_LOGI(TAG, "ESP32-S3 Serial Swiss Army Knife Phase 7E local UI reliability started");
|
||||
|
||||
if (esp_psram_is_initialized()) {
|
||||
ESP_LOGI(TAG, "PSRAM initialized: %u bytes", (unsigned int)esp_psram_get_size());
|
||||
@@ -77,6 +79,17 @@ void app_main(void)
|
||||
esp_err_to_name(local_ui_error));
|
||||
}
|
||||
|
||||
local_ui_config_t local_ui_config;
|
||||
bool used_stored_local_ui_config = false;
|
||||
esp_err_t local_ui_config_error =
|
||||
local_ui_config_load(&local_ui_config, &used_stored_local_ui_config);
|
||||
if (local_ui_config_error != ESP_OK) {
|
||||
local_ui_config_defaults(&local_ui_config);
|
||||
ESP_LOGW(TAG,
|
||||
"NVS local UI configuration unavailable (%s); using RAM defaults",
|
||||
esp_err_to_name(local_ui_config_error));
|
||||
}
|
||||
|
||||
serial_config_t serial_config;
|
||||
bool used_stored_config = false;
|
||||
esp_err_t config_error = serial_config_load(&serial_config, &used_stored_config);
|
||||
@@ -203,13 +216,15 @@ void app_main(void)
|
||||
}
|
||||
|
||||
if (local_ui_error == ESP_OK) {
|
||||
esp_err_t local_status_ui_error = local_status_ui_start();
|
||||
esp_err_t local_status_ui_error = local_status_ui_start(&local_ui_config);
|
||||
if (local_status_ui_error != ESP_OK) {
|
||||
ESP_LOGW(TAG, "Local status UI unavailable: %s",
|
||||
esp_err_to_name(local_status_ui_error));
|
||||
}
|
||||
}
|
||||
|
||||
ESP_LOGI(TAG, "Using %s local UI configuration",
|
||||
used_stored_local_ui_config ? "stored" : "default");
|
||||
ESP_LOGI(
|
||||
TAG,
|
||||
"Using %s serial configuration; UART service starts on 'serial start' or native USB open",
|
||||
@@ -235,6 +250,7 @@ void app_main(void)
|
||||
|
||||
/* The REPL constructor initializes esp_console and installs `help`. */
|
||||
ESP_ERROR_CHECK(rs232_hw_test_register_console_commands());
|
||||
ESP_ERROR_CHECK(local_ui_console_register_commands());
|
||||
ESP_ERROR_CHECK(serial_console_register_commands());
|
||||
ESP_ERROR_CHECK(session_console_register_commands());
|
||||
ESP_ERROR_CHECK(usb_console_register_commands());
|
||||
|
||||
Reference in New Issue
Block a user