From 57c8c2117dc1a81f7c557fced880e340da8237e8 Mon Sep 17 00:00:00 2001 From: erikkaashoek Date: Sat, 2 Apr 2022 15:58:01 +0200 Subject: [PATCH 1/8] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 54cf2e6..b278292 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,11 @@ enthusiast. This repository contains source of tinySA firmware. +# Support + +General tinySA support questions should be posted here: Please ask general support questions [here]: https://groups.io/g/tinysa/messages +Use github only for firmware bugs and preferrably cross post to: https://groups.io/g/tinysa/messages + ## Prepare ARM Cross Tools **UPDATE**: Recent gcc version works to build tinySA, no need old version. From a7e399ae36733d661c0211067519293bf08786ed Mon Sep 17 00:00:00 2001 From: erikkaashoek Date: Sat, 2 Apr 2022 15:59:01 +0200 Subject: [PATCH 2/8] Update README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b278292..fc3309d 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,9 @@ This repository contains source of tinySA firmware. # Support -General tinySA support questions should be posted here: Please ask general support questions [here]: https://groups.io/g/tinysa/messages -Use github only for firmware bugs and preferrably cross post to: https://groups.io/g/tinysa/messages +General tinySA support questions should be posted here: https://groups.io/g/tinysa/messages + +Use github issue list only for firmware bugs and preferrably cross post to: https://groups.io/g/tinysa/messages ## Prepare ARM Cross Tools From b87733e0a1af61885dbfb626373a02383ff017a6 Mon Sep 17 00:00:00 2001 From: erikkaashoek Date: Wed, 14 Dec 2022 08:42:58 +0100 Subject: [PATCH 3/8] Update README.md Add build command for Ultra --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index fc3309d..6d14c70 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,10 @@ Just make in the directory. $ make +For tinySA Ultra use this command + + $ make TARGET="F303" + ### Build firmware using docker Using [this docker image](https://hub.docker.com/r/edy555/arm-embedded) and without installing arm toolchain, you can build the firmware. From 2c9ea51157be8ab333eb47132c1dce8366fb3bbb Mon Sep 17 00:00:00 2001 From: DiSlord Live Date: Wed, 14 Dec 2022 21:37:20 +0300 Subject: [PATCH 4/8] Allow input ',' as float separator --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index a5f369a..d2f0132 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 deeaf098df643e61f3945167fe814e8d3462f66c Mon Sep 17 00:00:00 2001 From: DiSlord Live Date: Sun, 18 Dec 2022 00:31:50 +0300 Subject: [PATCH 5/8] 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 a96b64d64659648b2796e3f5187b764abea0f213 Mon Sep 17 00:00:00 2001 From: DiSlord Live Date: Wed, 21 Dec 2022 19:26:07 +0300 Subject: [PATCH 6/8] 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]) { From 71d231c2c4a58bf18e042c1fec144eb9dea511e7 Mon Sep 17 00:00:00 2001 From: DiSlord Live Date: Sun, 25 Dec 2022 10:11:14 +0300 Subject: [PATCH 7/8] Fix default touch calibration for 2.8 screen --- main.c | 2 +- nanovna.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index d585c6b..c9c6118 100644 --- a/main.c +++ b/main.c @@ -960,7 +960,7 @@ config_t config = { .dac_value = 1922, // .touch_cal = { 693, 605, 124, 171 }, // 2.4 inch LCD panel #ifdef TINYSA3 - .touch_cal = { 347, 495, 160, 205 }, // 2.8 inch LCD panel + .touch_cal = { 534, 741, 3458, 3434 }, // 2.8 inch LCD panel #endif #ifdef TINYSA4 .touch_cal = { 444, 715, 3552, 3499 }, // 4 inch panel diff --git a/nanovna.h b/nanovna.h index d50b145..c603e78 100644 --- a/nanovna.h +++ b/nanovna.h @@ -1384,7 +1384,7 @@ typedef struct properties { //sizeof(properties_t) == 0x1200 -#define CONFIG_MAGIC 0x434f4e5D /* 'CONF' */ +#define CONFIG_MAGIC 0x434f4e5F /* 'CONF' */ extern int16_t lastsaveid; //extern properties_t *active_props; From a21f85145246f865a2dc563087ac5fbea801e5cd Mon Sep 17 00:00:00 2001 From: DiSlord Live Date: Tue, 27 Dec 2022 22:36:15 +0300 Subject: [PATCH 8/8] Made sd_read as on NanoVNA, this allow add read command in App --- main.c | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/main.c b/main.c index c9c6118..e5873df 100644 --- a/main.c +++ b/main.c @@ -857,7 +857,7 @@ VNA_SHELL_FUNCTION(cmd_capture) static FRESULT cmd_sd_card_mount(void){ const FRESULT res = f_mount(fs_volume, "", 1); if (res != FR_OK) - shell_printf("err %d: no card\r\n",res); + shell_printf("err: (%d) no card\r\n",res); return res; } @@ -885,49 +885,43 @@ VNA_SHELL_FUNCTION(cmd_sd_list) res = f_findnext(&dj, &fno); } if (res != FR_OK) - shell_printf("err %d\r\n",res); + shell_printf("err: (%d)\r\n",res); f_closedir(&dj); } VNA_SHELL_FUNCTION(cmd_sd_read) { - DIR dj; - FILINFO fno; +// DIR dj; +// FILINFO fno; FRESULT res; char *buf = (char *)spi_buffer; if (argc != 1 || argv[0][0] == '?') { - usage_printf("sd_read {filename}\r\n"); + usage_printf("usage: sd_read {filename}\r\n"); return; } const char *filename = argv[0]; if (cmd_sd_card_mount() != FR_OK) return; - res = f_findfirst(&dj, &fno, "", filename); - if (res != FR_OK || fno.fname[0] == 0) - goto error; + // res = f_findfirst(&dj, &fno, "", filename); + // if (res != FR_OK || fno.fname[0] == 0) + // goto error; - - if (f_open(fs_file, fno.fname, FA_OPEN_EXISTING | FA_READ) != FR_OK){ -error: - shell_printf("err %d: no file\r\n",res); + if ((res = f_open(fs_file, filename, FA_OPEN_EXISTING | FA_READ)) != FR_OK){ +//error: + shell_printf("err: (%d) no file\r\n", res); return; } - // shell_printf("sd_read: %s\r\n", filename); // number of bytes to follow (file size) uint32_t filesize = f_size(fs_file); -#if 1 - shell_printf("%u\r\n", filesize); -#else streamWrite(shell_stream, (void *)&filesize, 4); -#endif UINT size = 0; // file data (send all data from file) while ((res=f_read(fs_file, buf, 512, &size)) == FR_OK && size > 0) streamWrite(shell_stream, (void *)buf, size); - if (res != FR_OK) - goto error; +// if (res != FR_OK) +// goto error; f_close(fs_file); return; }