mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-25 07:10:43 -04:00
Save individual app settings. Currently only for apps in Receive section and basic settings like, LNA, VGA, Rx Amp and Frequency.
This commit is contained in:
parent
dccc68a4e0
commit
799a473b36
31 changed files with 541 additions and 90 deletions
|
@ -200,44 +200,26 @@ void set_serial_format(const serial_format_t new_value) {
|
|||
data->serial_format = new_value;
|
||||
}
|
||||
|
||||
/* static constexpr uint32_t playdead_magic = 0x88d3bb57;
|
||||
|
||||
uint32_t playing_dead() {
|
||||
return data->playing_dead;
|
||||
}
|
||||
|
||||
void set_playing_dead(const uint32_t new_value) {
|
||||
if( data->playdead_magic != playdead_magic ) {
|
||||
set_playdead_sequence(0x8D1); // U D L R
|
||||
}
|
||||
data->playing_dead = new_value;
|
||||
}
|
||||
|
||||
uint32_t playdead_sequence() {
|
||||
if( data->playdead_magic != playdead_magic ) {
|
||||
set_playdead_sequence(0x8D1); // U D L R
|
||||
}
|
||||
return data->playdead_sequence;
|
||||
}
|
||||
|
||||
void set_playdead_sequence(const uint32_t new_value) {
|
||||
data->playdead_sequence = new_value;
|
||||
data->playdead_magic = playdead_magic;
|
||||
} */
|
||||
|
||||
// ui_config is an uint32_t var storing information bitwise
|
||||
// bits 0,1,2 store the backlight timer
|
||||
// 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 0-2 store the backlight timer
|
||||
// bits 4-19 (16 bits) store the clkout frequency
|
||||
// bits 21-31 store the different single bit configs depicted below
|
||||
bool load_app_settings() { // load (last saved) app settings on startup of app
|
||||
return data->ui_config & (1 << 21);
|
||||
}
|
||||
|
||||
bool disable_touchscreen() { // Option to disable touch screen
|
||||
return data->ui_config & (1 << 24);
|
||||
bool save_app_settings() { // save app settings when closing app
|
||||
return data->ui_config & (1 << 22);
|
||||
}
|
||||
|
||||
bool show_bigger_qr_code() { // show bigger QR code
|
||||
return data->ui_config & (1 << 23);
|
||||
}
|
||||
|
||||
bool disable_touchscreen() { // Option to disable touch screen
|
||||
return data->ui_config & (1 << 24);
|
||||
}
|
||||
|
||||
bool hide_clock() { // clock hidden from main menu
|
||||
return data->ui_config & (1 << 25);
|
||||
}
|
||||
|
@ -274,14 +256,22 @@ uint32_t config_backlight_timer() {
|
|||
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_load_app_settings(bool v) {
|
||||
data->ui_config = (data->ui_config & ~(1 << 21)) | (v << 21);
|
||||
}
|
||||
|
||||
|
||||
void set_save_app_settings(bool v) {
|
||||
data->ui_config = (data->ui_config & ~(1 << 22)) | (v << 22);
|
||||
}
|
||||
|
||||
void set_show_bigger_qr_code(bool v) {
|
||||
data->ui_config = (data->ui_config & ~(1 << 23)) | (v << 23);
|
||||
}
|
||||
|
||||
void set_disable_touchscreen(bool v) {
|
||||
data->ui_config = (data->ui_config & ~(1 << 24)) | (v << 24);
|
||||
}
|
||||
|
||||
void set_clock_hidden(bool v) {
|
||||
data->ui_config = (data->ui_config & ~(1 << 25)) | (v << 25);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue