mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-02-03 10:00:12 -05:00
Merge pull request #482 from zigad/feature/disableTouch
Enable / Disable Touchscreen
This commit is contained in:
commit
1f27af660d
@ -228,6 +228,7 @@ SetFrequencyCorrectionModel SetRadioView::form_collect() {
|
|||||||
SetUIView::SetUIView(NavigationView& nav) {
|
SetUIView::SetUIView(NavigationView& nav) {
|
||||||
add_children({
|
add_children({
|
||||||
//&checkbox_login,
|
//&checkbox_login,
|
||||||
|
&checkbox_disable_touchscreen,
|
||||||
&checkbox_speaker,
|
&checkbox_speaker,
|
||||||
&checkbox_bloff,
|
&checkbox_bloff,
|
||||||
&options_bloff,
|
&options_bloff,
|
||||||
@ -237,6 +238,7 @@ SetUIView::SetUIView(NavigationView& nav) {
|
|||||||
&button_ok
|
&button_ok
|
||||||
});
|
});
|
||||||
|
|
||||||
|
checkbox_disable_touchscreen.set_value(persistent_memory::disable_touchscreen());
|
||||||
checkbox_speaker.set_value(persistent_memory::config_speaker());
|
checkbox_speaker.set_value(persistent_memory::config_speaker());
|
||||||
checkbox_showsplash.set_value(persistent_memory::config_splash());
|
checkbox_showsplash.set_value(persistent_memory::config_splash());
|
||||||
checkbox_showclock.set_value(!persistent_memory::hide_clock());
|
checkbox_showclock.set_value(!persistent_memory::hide_clock());
|
||||||
@ -278,6 +280,7 @@ SetUIView::SetUIView(NavigationView& nav) {
|
|||||||
}
|
}
|
||||||
persistent_memory::set_config_splash(checkbox_showsplash.value());
|
persistent_memory::set_config_splash(checkbox_showsplash.value());
|
||||||
persistent_memory::set_clock_hidden(!checkbox_showclock.value());
|
persistent_memory::set_clock_hidden(!checkbox_showclock.value());
|
||||||
|
persistent_memory::set_disable_touchscreen(checkbox_disable_touchscreen.value());
|
||||||
//persistent_memory::set_config_login(checkbox_login.value());
|
//persistent_memory::set_config_login(checkbox_login.value());
|
||||||
nav.pop();
|
nav.pop();
|
||||||
};
|
};
|
||||||
|
@ -220,6 +220,12 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
Checkbox checkbox_disable_touchscreen {
|
||||||
|
{ 3 * 8, 2 * 16 },
|
||||||
|
20,
|
||||||
|
"Disable touchscreen"
|
||||||
|
};
|
||||||
|
|
||||||
Checkbox checkbox_speaker {
|
Checkbox checkbox_speaker {
|
||||||
{ 3 * 8, 4 * 16 },
|
{ 3 * 8, 4 * 16 },
|
||||||
20,
|
20,
|
||||||
|
@ -109,7 +109,7 @@ void Manager::feed(const Frame& frame) {
|
|||||||
|
|
||||||
switch(state) {
|
switch(state) {
|
||||||
case State::NoTouch:
|
case State::NoTouch:
|
||||||
if( touch_stable && touch_pressure ) {
|
if( touch_stable && touch_pressure && !persistent_memory::disable_touchscreen()) {
|
||||||
if( point_stable() ) {
|
if( point_stable() ) {
|
||||||
state = State::TouchDetected;
|
state = State::TouchDetected;
|
||||||
touch_started();
|
touch_started();
|
||||||
|
@ -227,9 +227,13 @@ void set_playdead_sequence(const uint32_t new_value) {
|
|||||||
|
|
||||||
// ui_config is an uint32_t var storing information bitwise
|
// ui_config is an uint32_t var storing information bitwise
|
||||||
// bits 0,1,2 store the backlight timer
|
// bits 0,1,2 store the backlight timer
|
||||||
// bits 31, 30,29,28,27, 26, 25 stores the different single bit configs depicted below
|
// bits 31, 30,29,28,27, 26, 25, 24 stores the different single bit configs depicted below
|
||||||
// bits on position 4 to 19 (16 bits) store the clkout frequency
|
// bits on position 4 to 19 (16 bits) store the clkout frequency
|
||||||
|
|
||||||
|
bool disable_touchscreen() { // Option to disable touch screen
|
||||||
|
return data->ui_config & (1 << 24);
|
||||||
|
}
|
||||||
|
|
||||||
bool show_bigger_qr_code() { // show bigger QR code
|
bool show_bigger_qr_code() { // show bigger QR code
|
||||||
return data->ui_config & (1 << 23);
|
return data->ui_config & (1 << 23);
|
||||||
}
|
}
|
||||||
@ -270,6 +274,10 @@ uint32_t config_backlight_timer() {
|
|||||||
return timer_seconds[data->ui_config & 7]; //first three bits, 8 possible values
|
return timer_seconds[data->ui_config & 7]; //first three bits, 8 possible values
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void set_disable_touchscreen(bool v) {
|
||||||
|
data->ui_config = (data->ui_config & ~(1 << 24)) | (v << 24);
|
||||||
|
}
|
||||||
|
|
||||||
void set_show_bigger_qr_code(bool v) {
|
void set_show_bigger_qr_code(bool v) {
|
||||||
data->ui_config = (data->ui_config & ~(1 << 23)) | (v << 23);
|
data->ui_config = (data->ui_config & ~(1 << 23)) | (v << 23);
|
||||||
}
|
}
|
||||||
|
@ -84,6 +84,7 @@ bool clock_with_date();
|
|||||||
bool config_login();
|
bool config_login();
|
||||||
bool config_speaker();
|
bool config_speaker();
|
||||||
uint32_t config_backlight_timer();
|
uint32_t config_backlight_timer();
|
||||||
|
bool disable_touchscreen();
|
||||||
|
|
||||||
void set_config_splash(bool v);
|
void set_config_splash(bool v);
|
||||||
void set_show_bigger_qr_code(bool v);
|
void set_show_bigger_qr_code(bool v);
|
||||||
@ -92,6 +93,7 @@ void set_clock_with_date(bool v);
|
|||||||
void set_config_login(bool v);
|
void set_config_login(bool v);
|
||||||
void set_config_speaker(bool v);
|
void set_config_speaker(bool v);
|
||||||
void set_config_backlight_timer(uint32_t i);
|
void set_config_backlight_timer(uint32_t i);
|
||||||
|
void set_disable_touchscreen(bool v);
|
||||||
|
|
||||||
//uint8_t ui_config_textentry();
|
//uint8_t ui_config_textentry();
|
||||||
//void set_config_textentry(uint8_t new_value);
|
//void set_config_textentry(uint8_t new_value);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user