From 563c63b6309738becacddcd49489bc8d744b4115 Mon Sep 17 00:00:00 2001 From: erikkaashoek Date: Thu, 22 Dec 2022 10:10:01 +0100 Subject: [PATCH 1/4] Big Freq display bug solved --- plot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plot.c b/plot.c index f0e5ed6..183f688 100644 --- a/plot.c +++ b/plot.c @@ -1550,7 +1550,7 @@ static void trace_print_value_string( // Only used at one place } #ifdef __LEVEL_METER__ #ifdef TINYSA4 - if (freq_text[0] == 0) strcpy(freq_text, &ptr2[3]); + if (freq_text[0] == 0) strcpy(freq_text, &ptr2[0]); #endif #endif const char *format; From 406650fdf9dcbe90a3763453235b79e6e7ed41dd Mon Sep 17 00:00:00 2001 From: DiSlord Live Date: Wed, 14 Dec 2022 21:37:20 +0300 Subject: [PATCH 2/4] Allow input ',' as float separator --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 3db6d22..a420f9b 100644 --- a/main.c +++ b/main.c @@ -529,7 +529,7 @@ my_atof(const char *p) p++; if (*p == 'k' || *p == 'M' || *p == 'G') p++; - if (*p == '.') { + if (*p == '.' || *p == ',') { float d = 1.0; p++; while (_isdigit((int)*p)) { From b4ca2d342377bd1803345e8953ecca683721124a Mon Sep 17 00:00:00 2001 From: DiSlord Live Date: Sun, 18 Dec 2022 00:31:50 +0300 Subject: [PATCH 3/4] Show brightness value on button and select --- ui.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/ui.c b/ui.c index 2b21b78..28e0a61 100644 --- a/ui.c +++ b/ui.c @@ -3300,34 +3300,40 @@ static UI_FUNCTION_ADV_CALLBACK(menu_settings_bpf_acb){ } #ifdef __LCD_BRIGHTNESS__ -static UI_FUNCTION_CALLBACK(menu_brightness_cb) +static UI_FUNCTION_ADV_CALLBACK(menu_brightness_acb) { (void)item; (void)data; + if (b){ + b->param_1.u = config._brightness; + return; + } int16_t value = config._brightness; ili9341_set_foreground(LCD_MENU_TEXT_COLOR); ili9341_set_background(LCD_MENU_COLOR); - ili9341_fill(LCD_WIDTH/2-80, LCD_HEIGHT/2-20, 160, 40); - ili9341_drawstring_7x13("BRIGHTNESS", LCD_WIDTH/2-35, LCD_HEIGHT/2-13); - ili9341_drawstring_7x13(S_LARROW" USE LEVELER BUTTON "S_RARROW, LCD_WIDTH/2-72, LCD_HEIGHT/2+2); + lcd_set_font(FONT_NORMAL); + ili9341_fill(LCD_WIDTH/2-12*bFONT_WIDTH, LCD_HEIGHT/2-20, 23*bFONT_WIDTH, 40); + lcd_printf(LCD_WIDTH/2-8*bFONT_WIDTH, LCD_HEIGHT/2-13, "BRIGHTNESS %3d%% ", value); + lcd_printf(LCD_WIDTH/2-11*bFONT_WIDTH, LCD_HEIGHT/2+2, S_LARROW " USE LEVELER BUTTON " S_RARROW); while (TRUE) { - int status = btn_check(); + uint16_t status = btn_check(); if (status & (EVT_UP|EVT_DOWN)) { do { if (status & EVT_UP ) value+=5; if (status & EVT_DOWN) value-=5; if (value < 0) value = 0; if (value > 100) value = 100; + lcd_printf(LCD_WIDTH/2-8*bFONT_WIDTH, LCD_HEIGHT/2-13, "BRIGHTNESS %3d%% ", value); lcd_setBrightness(value); - status = btn_wait_release(); - } while (status != 0); + chThdSleepMilliseconds(100); + } while ((status = btn_wait_release()) != 0); } if (status == EVT_BUTTON_SINGLE_CLICK) break; } config._brightness = (uint8_t)value; - lcd_setBrightness(value); redraw_request|= REDRAW_AREA; + lcd_set_font(FONT_SMALL); ui_mode_normal(); } #endif @@ -4315,7 +4321,7 @@ static const menuitem_t menu_config[] = { #endif { MT_KEYPAD, KM_REPEAT, "SAMPLE REP\n\b%s", "1..100"}, #ifdef __LCD_BRIGHTNESS__ - { MT_CALLBACK, 0, "BRIGHTNESS", menu_brightness_cb}, + { MT_ADV_CALLBACK, 0, "BRIGHTNESS\n \b%d%%", menu_brightness_acb}, #endif #ifdef __USE_RTC__ { MT_SUBMENU, 0, "DATE\nTIME", menu_date_time}, From 00bde877e494ae77d0b2105b52b532e185816adc Mon Sep 17 00:00:00 2001 From: DiSlord Live Date: Wed, 21 Dec 2022 19:26:07 +0300 Subject: [PATCH 4/4] Remove sd_list output string --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index a420f9b..d585c6b 100644 --- a/main.c +++ b/main.c @@ -877,7 +877,7 @@ VNA_SHELL_FUNCTION(cmd_sd_list) case 1: search = argv[0];break; default: usage_printf("sd_list {pattern}\r\n"); return; } - shell_printf("sd_list:\r\n"); +// shell_printf("sd_list:\r\n"); res = f_findfirst(&dj, &fno, "", search); while (res == FR_OK && fno.fname[0]) {