diff --git a/firmware/application/apps/ui_settings.cpp b/firmware/application/apps/ui_settings.cpp index fbda02b72..b9fd06a80 100644 --- a/firmware/application/apps/ui_settings.cpp +++ b/firmware/application/apps/ui_settings.cpp @@ -294,6 +294,7 @@ SetUIView::SetUIView(NavigationView& nav) { checkbox_showsplash.set_value(persistent_memory::config_splash()); checkbox_showclock.set_value(!persistent_memory::hide_clock()); //checkbox_login.set_value(persistent_memory::config_login()); + //Add code for touch disabled uint32_t backlight_timer = persistent_memory::config_backlight_timer(); if (backlight_timer) { diff --git a/firmware/application/touch.cpp b/firmware/application/touch.cpp index d3fc6c925..98f2a0a41 100644 --- a/firmware/application/touch.cpp +++ b/firmware/application/touch.cpp @@ -109,7 +109,7 @@ void Manager::feed(const Frame& frame) { switch(state) { case State::NoTouch: - if( touch_stable && touch_pressure ) { + if( touch_stable && touch_pressure ) {//Add code for touch disabled if( point_stable() ) { state = State::TouchDetected; touch_started(); diff --git a/firmware/common/portapack_persistent_memory.cpp b/firmware/common/portapack_persistent_memory.cpp index 2bee6470e..367d16091 100644 --- a/firmware/common/portapack_persistent_memory.cpp +++ b/firmware/common/portapack_persistent_memory.cpp @@ -254,6 +254,10 @@ bool config_splash() { return data->ui_config & (1 << 31); } +bool touch_screen_enabled() { + return data->ui_config & (1 << 32); +} + uint32_t config_backlight_timer() { const uint32_t timer_seconds[8] = { 0, 5, 15, 30, 60, 180, 300, 600 }; return timer_seconds[data->ui_config & 7]; //first three bits, 8 possible values @@ -291,6 +295,10 @@ void set_config_backlight_timer(uint32_t i) { data->ui_config = (data->ui_config & ~7) | (i & 7); } +void set_touch_screen_enabled(bool v) { + data->ui_config = (data->ui_config & ~(1 << 32)) | (v << 32); +} + /*void set_config_textentry(uint8_t new_value) { data->ui_config = (data->ui_config & ~0b100) | ((new_value & 1) << 2); } diff --git a/firmware/common/portapack_persistent_memory.hpp b/firmware/common/portapack_persistent_memory.hpp index 11643bab3..45936f55c 100644 --- a/firmware/common/portapack_persistent_memory.hpp +++ b/firmware/common/portapack_persistent_memory.hpp @@ -80,6 +80,7 @@ bool clock_with_date(); bool config_login(); bool config_speaker(); uint32_t config_backlight_timer(); +bool touch_screen_enabled(); void set_config_splash(bool v); void set_clock_hidden(bool v); @@ -87,6 +88,7 @@ void set_clock_with_date(bool v); void set_config_login(bool v); void set_config_speaker(bool v); void set_config_backlight_timer(uint32_t i); +void set_touch_screen_enabled(bool v); //uint8_t ui_config_textentry(); //void set_config_textentry(uint8_t new_value);