mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-01-12 07:49:32 -05:00
Enable / Disable Touchscreen #481
This commit will reverse the logic of touch screen as suggested by @ArjanOnwezen
This commit is contained in:
parent
4a0d42ed34
commit
cebbc12084
@ -281,7 +281,7 @@ void SetPlayDeadView::focus() {
|
|||||||
SetUIView::SetUIView(NavigationView& nav) {
|
SetUIView::SetUIView(NavigationView& nav) {
|
||||||
add_children({
|
add_children({
|
||||||
//&checkbox_login,
|
//&checkbox_login,
|
||||||
&checkbox_enable_touchscreen,
|
&checkbox_disable_touchscreen,
|
||||||
&checkbox_speaker,
|
&checkbox_speaker,
|
||||||
&checkbox_bloff,
|
&checkbox_bloff,
|
||||||
&options_bloff,
|
&options_bloff,
|
||||||
@ -291,7 +291,7 @@ SetUIView::SetUIView(NavigationView& nav) {
|
|||||||
&button_ok
|
&button_ok
|
||||||
});
|
});
|
||||||
|
|
||||||
checkbox_enable_touchscreen.set_value(persistent_memory::enable_touchscreen());
|
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());
|
||||||
@ -334,7 +334,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_enable_touchscreen(checkbox_enable_touchscreen.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();
|
||||||
};
|
};
|
||||||
|
@ -225,10 +225,10 @@ private:
|
|||||||
"Login with play dead"
|
"Login with play dead"
|
||||||
};*/
|
};*/
|
||||||
|
|
||||||
Checkbox checkbox_enable_touchscreen {
|
Checkbox checkbox_disable_touchscreen {
|
||||||
{ 3 * 8, 2 * 16 },
|
{ 3 * 8, 2 * 16 },
|
||||||
20,
|
20,
|
||||||
"Enable touchscreen"
|
"Disable touchscreen"
|
||||||
};
|
};
|
||||||
|
|
||||||
Checkbox checkbox_speaker {
|
Checkbox checkbox_speaker {
|
||||||
|
@ -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 && persistent_memory::enable_touchscreen()) {
|
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,7 +227,7 @@ void set_playdead_sequence(const uint32_t new_value) {
|
|||||||
// bits 31, 30,29,28,27, 26, 25, 24 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 enable_touchscreen() { // Option to disable touch screen
|
bool disable_touchscreen() { // Option to disable touch screen
|
||||||
return data->ui_config & (1 << 24);
|
return data->ui_config & (1 << 24);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,7 +263,7 @@ 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_enable_touchscreen(bool v) {
|
void set_disable_touchscreen(bool v) {
|
||||||
data->ui_config = (data->ui_config & ~(1 << 24)) | (v << 24);
|
data->ui_config = (data->ui_config & ~(1 << 24)) | (v << 24);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +80,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 enable_touchscreen();
|
bool disable_touchscreen();
|
||||||
|
|
||||||
void set_config_splash(bool v);
|
void set_config_splash(bool v);
|
||||||
void set_clock_hidden(bool v);
|
void set_clock_hidden(bool v);
|
||||||
@ -88,7 +88,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_enable_touchscreen(bool v);
|
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…
Reference in New Issue
Block a user