Jog sideways resets state

pwm
erikkaashoek 3 years ago
parent 74e877c524
commit 0817853f53

@ -2686,15 +2686,19 @@ int main(void)
if (has_new_switch)
config.switch_offset = -5.0;
#endif
int reset_state = btn_side();
if (!reset_state) {
if(config_recall()) {
clear_backup();
}
}
config.cor_am = 0; // Should be removed from config
config.cor_nfm = 0;
config.cor_wfm = 0;
ili9341_flip(config.flip);
if (caldata_recall(0) == -1) {
if (reset_state || caldata_recall(0) == -1) {
load_LCD_properties();
}
#ifdef __ULTRA__
@ -2738,11 +2742,11 @@ int main(void)
sweep(false);
#endif
if (caldata_recall(0) == -1) {
if (reset_state|| (caldata_recall(0) == -1)) {
load_LCD_properties();
}
ui_mode_normal();
if (!(config._mode & _MODE_DONT_SAVE_STATE)) {
if ((!reset_state) && !(config._mode & _MODE_DONT_SAVE_STATE) ) {
backup_t b;
uint32_t *f = &backup;
uint32_t *t = (uint32_t *)&b;

@ -1479,6 +1479,7 @@ void refresh_sweep_menu(int i);
void save_to_sd(int mask);
void drawMessageBox(const char *header, char *text, uint32_t delay);
bool isFullScreenMode(void);
int btn_side(void);
// Irq operation process set
#define OP_NONE 0x00

@ -173,6 +173,14 @@ bool isFullScreenMode(void) {
#endif
}
int btn_side(void)
{
uint16_t cur_button = READ_PORT() & BUTTON_MASK;
if (cur_button & (1<<BIT_UP1) || cur_button & (1<<BIT_DOWN1))
return true;
return false;
}
static int btn_check(void)
{
systime_t ticks;

Loading…
Cancel
Save

Powered by TurnKey Linux.