Add persistent OLED UI settings and recovery
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
/* SPDX-License-Identifier: GPL-3.0-only */
|
||||
/* Versioned persistent configuration for the optional local OLED UI. */
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "esp_err.h"
|
||||
|
||||
#define LOCAL_UI_CONFIG_VERSION 1U
|
||||
#define LOCAL_UI_CONFIG_DEFAULT_DIM_SECONDS 300U
|
||||
#define LOCAL_UI_CONFIG_DEFAULT_OFF_SECONDS 600U
|
||||
#define LOCAL_UI_CONFIG_MAX_TIMEOUT_SECONDS 86400U
|
||||
|
||||
#define LOCAL_UI_CONFIG_NVS_NAMESPACE "local_ui"
|
||||
#define LOCAL_UI_CONFIG_NVS_BLOB_KEY "config"
|
||||
|
||||
typedef struct {
|
||||
uint32_t version;
|
||||
/* Zero disables the corresponding inactivity transition. */
|
||||
uint32_t dim_timeout_seconds;
|
||||
uint32_t off_timeout_seconds;
|
||||
} local_ui_config_t;
|
||||
|
||||
void local_ui_config_defaults(local_ui_config_t *config);
|
||||
esp_err_t local_ui_config_validate(const local_ui_config_t *config);
|
||||
esp_err_t local_ui_config_load(local_ui_config_t *config, bool *used_stored_config);
|
||||
esp_err_t local_ui_config_save(const local_ui_config_t *config);
|
||||
esp_err_t local_ui_config_reset_storage(void);
|
||||
Reference in New Issue
Block a user