mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-29 09:07:17 -04:00
Persistent memory check value verification, defaulting when fails. (#662)
* Make default constructor for touch calibration * Add persistent memory check value and access abstraction. * Add persistent data_t default constructor with reasonable defaults. * serial_format_t default constructor. * Tidy up backlight timeout type. * Add persistent data struct version/checking. * Make range_t functions constexpr. * Move ui_config and functions into class. * Add backlight_config_t struct, separate enable and time settings.
This commit is contained in:
parent
2031a79b34
commit
e5a30b4309
11 changed files with 481 additions and 94 deletions
|
@ -226,15 +226,17 @@ void EventDispatcher::handle_rtc_tick() {
|
|||
|
||||
portapack::temperature_logger.second_tick();
|
||||
|
||||
uint32_t backlight_timer = portapack::persistent_memory::config_backlight_timer();
|
||||
if (backlight_timer) {
|
||||
if (portapack::bl_tick_counter == backlight_timer)
|
||||
const auto backlight_timer = portapack::persistent_memory::config_backlight_timer();
|
||||
if (backlight_timer.timeout_enabled()) {
|
||||
if (portapack::bl_tick_counter == backlight_timer.timeout_seconds())
|
||||
set_display_sleep(true);
|
||||
else
|
||||
portapack::bl_tick_counter++;
|
||||
}
|
||||
|
||||
rtc_time::on_tick_second();
|
||||
|
||||
portapack::persistent_memory::cache::persist();
|
||||
}
|
||||
|
||||
ui::Widget* EventDispatcher::touch_widget(ui::Widget* const w, ui::TouchEvent event) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue