From 74352459b07f155bac1c8dd8cc41dfe5c065952b Mon Sep 17 00:00:00 2001 From: DiSlord Date: Mon, 31 May 2021 23:17:27 +0300 Subject: [PATCH] Fix lever button work Remove double usage --- main.c | 11 ++++++----- ui.c | 7 +++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/main.c b/main.c index 3a86d99f..ac8da671 100644 --- a/main.c +++ b/main.c @@ -129,7 +129,7 @@ static float kaiser_data[FFT_SIZE]; #endif #undef VERSION -#define VERSION "1.0.63" +#define VERSION "1.0.64" // Version text, displayed in Config->Version menu, also send by info command const char *info_about[]={ @@ -549,7 +549,7 @@ VNA_SHELL_FUNCTION(cmd_reset) { (void)argc; (void)argv; - +#ifdef __DFU_SOFTWARE_MODE__ if (argc == 1) { if (get_str_index(argv[0], "dfu") == 0) { shell_printf("Performing reset to DFU mode\r\n"); @@ -557,6 +557,7 @@ VNA_SHELL_FUNCTION(cmd_reset) return; } } +#endif shell_printf("Performing reset\r\n"); rccEnableWWDG(FALSE); @@ -622,14 +623,14 @@ my_atof(const char *p) neg = TRUE; if (*p == '-' || *p == '+') p++; - double x = my_atoi(p); + float x = my_atoi(p); while (_isdigit((int)*p)) p++; if (*p == '.') { - double d = 1.0f; + float d = 1.0f; p++; while (_isdigit((int)*p)) { - d /= 10; + d /= 10.0f; x += d * (*p - '0'); p++; } diff --git a/ui.c b/ui.c index ec7f270b..ffa7b19a 100644 --- a/ui.c +++ b/ui.c @@ -531,12 +531,11 @@ show_version(void) } } +#ifdef __DFU_SOFTWARE_MODE__ void enter_dfu(void) { -#ifdef __DFU_SOFTWARE_MODE__ touch_stop_watchdog(); - int x = 5, y = 20; lcd_set_foreground(LCD_FG_COLOR); lcd_set_background(LCD_BG_COLOR); @@ -547,8 +546,8 @@ enter_dfu(void) // see __early_init in ./NANOVNA_STM32_F072/board.c *((unsigned long *)BOOT_FROM_SYTEM_MEMORY_MAGIC_ADDRESS) = BOOT_FROM_SYTEM_MEMORY_MAGIC; NVIC_SystemReset(); -#endif } +#endif static bool select_lever_mode(int mode) @@ -2721,7 +2720,7 @@ normal_apply_touch(int touch_x, int touch_y){ static void ui_process_lever(void) { - last_button = 0; +// last_button = 0; uint16_t status = btn_check(); if (status == 0) return; switch (ui_mode) {