Merge branch 'next' into feature/disableTouch

This commit is contained in:
ArjanOnwezen 2022-04-08 16:10:55 +02:00 committed by GitHub
commit a9d2b2ff8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
84 changed files with 37068 additions and 35942 deletions

View file

@ -82,7 +82,7 @@ struct data_t {
int32_t afsk_space_freq;
int32_t modem_baudrate;
int32_t modem_repeat;
// Play dead unlock
uint32_t playdead_magic;
uint32_t playing_dead;
@ -95,6 +95,9 @@ struct data_t {
uint32_t pocsag_ignore_address;
int32_t tone_mix;
// Hardware
uint32_t hardware_config;
};
static_assert(sizeof(data_t) <= backup_ram.size(), "Persistent memory structure too large for VBAT-maintained region");
@ -230,6 +233,10 @@ void set_playdead_sequence(const uint32_t new_value) {
bool disable_touchscreen() { // Option to disable touch screen
return data->ui_config & (1 << 24);
}
bool show_bigger_qr_code() { // show bigger QR code
return data->ui_config & (1 << 23);
}
bool hide_clock() { // clock hidden from main menu
return data->ui_config & (1 << 25);
@ -258,6 +265,10 @@ bool config_splash() {
return data->ui_config & (1 << 31);
}
uint8_t config_cpld() {
return data->hardware_config;
}
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
@ -266,6 +277,10 @@ uint32_t config_backlight_timer() {
void set_disable_touchscreen(bool v) {
data->ui_config = (data->ui_config & ~(1 << 24)) | (v << 24);
}
void set_show_bigger_qr_code(bool v) {
data->ui_config = (data->ui_config & ~(1 << 23)) | (v << 23);
}
void set_clock_hidden(bool v) {
data->ui_config = (data->ui_config & ~(1 << 25)) | (v << 25);
@ -295,6 +310,10 @@ void set_config_splash(bool v) {
data->ui_config = (data->ui_config & ~(1 << 31)) | (v << 31);
}
void set_config_cpld(uint8_t i) {
data->hardware_config = i;
}
void set_config_backlight_timer(uint32_t i) {
data->ui_config = (data->ui_config & ~7) | (i & 7);
}