From 0afeac69749477f5ae27abc5c12bb3339d071ff0 Mon Sep 17 00:00:00 2001 From: erikkaashoek Date: Thu, 27 May 2021 07:42:30 +0200 Subject: [PATCH 1/6] Endless AVER added --- main.c | 1 + nanovna.h | 3 ++- sa_core.c | 9 +++++++-- ui_sa.c | 22 +++++++++++----------- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/main.c b/main.c index 6f54a3f..42ec8b3 100644 --- a/main.c +++ b/main.c @@ -103,6 +103,7 @@ const char *info_about[]={ }; bool dirty = true; +int32_t scan_after_dirty = 0; uint8_t completed = false; uint8_t enable_after_complete = 0; diff --git a/nanovna.h b/nanovna.h index d9384a4..1f656a2 100644 --- a/nanovna.h +++ b/nanovna.h @@ -206,8 +206,9 @@ void toggle_pulse(void); void load_default_properties(void); enum { - AV_OFF, AV_MIN, AV_MAX_HOLD, AV_MAX_DECAY, AV_4, AV_16, AV_QUASI, AV_DECONV + AV_OFF, AV_MIN, AV_MAX_HOLD, AV_MAX_DECAY, AV_4, AV_16, AV_100, AV_QUASI, AV_DECONV }; + enum { M_LOW, M_HIGH, M_GENLOW, M_GENHIGH, M_ULTRA }; diff --git a/sa_core.c b/sa_core.c index a24d8bf..d7671bb 100644 --- a/sa_core.c +++ b/sa_core.c @@ -2636,6 +2636,7 @@ pureRSSI_t perform(bool break_on_operation, int i, freq_t f, int tracking) / old_a = -150; // clear cached level setting // Initialize HW scandirty = true; // This is the first pass with new settings + scan_after_dirty = 0; dirty = false; sweep_elapsed = chVTGetSystemTimeX(); // for measuring accumulated time // Set for actual time pre calculated value (update after sweep) @@ -2681,6 +2682,9 @@ pureRSSI_t perform(bool break_on_operation, int i, freq_t f, int tracking) / } } } + if (i == 0) + scan_after_dirty += 1; + // --------------------------------- Pulse at start of low output sweep -------------------------- @@ -4040,8 +4044,9 @@ static volatile int dummy; age[i] += 1; } break; - case AV_4: actual_t[i] = (actual_t[i]*3 + RSSI) / 4.0; break; - case AV_16: actual_t[i] = (actual_t[i]*15 + RSSI) / 16.0; break; + case AV_4: actual_t[i] = (actual_t[i]*3.0 + RSSI) / 4.0; break; + case AV_16: actual_t[i] = (actual_t[i]*15.0 + RSSI) / 16.0; break; + case AV_100:actual_t[i] = (actual_t[i]*(scan_after_dirty-1) + RSSI) / scan_after_dirty; break; #ifdef __QUASI_PEAK__ case AV_QUASI: { static float old_RSSI = -150.0; diff --git a/ui_sa.c b/ui_sa.c index 7c0ff97..883f54d 100644 --- a/ui_sa.c +++ b/ui_sa.c @@ -1136,10 +1136,7 @@ static UI_FUNCTION_CALLBACK(menu_clearconfig_cb) ui_mode_normal(); } - - - -const char * const averageText[] = { "OFF", "MIN", "MAX", "MAXD", " A 4", "A 16","QUASI", "DECONV"}; +const char * const averageText[] = { "OFF", "MIN", "MAX", "MAXD", " A 4", "A 16", "AVER", "QUASI", "DECONV"}; static UI_FUNCTION_ADV_CALLBACK(menu_measure_acb) { @@ -2108,14 +2105,17 @@ static const menuitem_t menu_highoutputmode[] = { }; static const menuitem_t menu_average[] = { - { MT_ADV_CALLBACK, 0, "OFF", menu_average_acb}, - { MT_ADV_CALLBACK, 1, "MIN\nHOLD", menu_average_acb}, - { MT_ADV_CALLBACK, 2, "MAX\nHOLD", menu_average_acb}, - { MT_ADV_CALLBACK, 3, "MAX\nDECAY", menu_average_acb}, - { MT_ADV_CALLBACK, 4, "AVER 4", menu_average_acb}, - { MT_ADV_CALLBACK, 5, "AVER 16", menu_average_acb}, + { MT_ADV_CALLBACK, AV_OFF, "OFF", menu_average_acb}, + { MT_ADV_CALLBACK, AV_MIN, "MIN\nHOLD", menu_average_acb}, + { MT_ADV_CALLBACK, AV_MAX_HOLD, "MAX\nHOLD", menu_average_acb}, + { MT_ADV_CALLBACK, AV_MAX_DECAY, "MAX\nDECAY", menu_average_acb}, + { MT_ADV_CALLBACK, AV_4, "AVER 4", menu_average_acb}, + { MT_ADV_CALLBACK, AV_16, "AVER 16", menu_average_acb}, +#ifdef TINYSA4 + { MT_ADV_CALLBACK, AV_100, "AVER", menu_average_acb}, +#endif #ifdef __QUASI_PEAK__ - { MT_ADV_CALLBACK, 6, "QUASI\nPEAK", menu_average_acb}, + { MT_ADV_CALLBACK, AV_QUASI, "QUASI\nPEAK", menu_average_acb}, #endif { MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, NULL } // sentinel From b37ac83ef3e8162a5a5339c223b0c7495ca69c89 Mon Sep 17 00:00:00 2001 From: DiSlord Date: Sun, 23 May 2021 18:56:03 +0300 Subject: [PATCH 2/6] Use defines in header for SD card buffers --- main.c | 4 ---- nanovna.h | 11 +++++++++++ ui.c | 13 ------------- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/main.c b/main.c index 42ec8b3..e68c254 100644 --- a/main.c +++ b/main.c @@ -763,10 +763,6 @@ void send_buffer(uint8_t * buf, int s) #ifndef __USE_SD_CARD__ #error "Need enable SD card support __USE_SD_CARD__ in nanovna.h, for use ENABLE_SD_CARD_CMD" #endif -// Fat file system work area (at the end of spi_buffer) -static FATFS *fs_volume = (FATFS *)(((uint8_t*)(&spi_buffer[SPI_BUFFER_SIZE])) - sizeof(FATFS)); -// FatFS file object (at the end of spi_buffer) -static FIL *fs_file = ( FIL*)(((uint8_t*)(&spi_buffer[SPI_BUFFER_SIZE])) - sizeof(FATFS) - sizeof(FIL)); static FRESULT cmd_sd_card_mount(void){ const FRESULT res = f_mount(fs_volume, "", 1); diff --git a/nanovna.h b/nanovna.h index 1f656a2..a63079a 100644 --- a/nanovna.h +++ b/nanovna.h @@ -1323,6 +1323,17 @@ void rtc_set_time(uint32_t dr, uint32_t tr); #include "../FatFs/ff.h" #include "../FatFs/diskio.h" bool SD_Inserted(void); +// Buffers for SD card use spi_buffer +#if SPI_BUFFER_SIZE < 2048 +#error "SPI_BUFFER_SIZE for SD card support need size >= 2048" +#else +// Fat file system work area (at the end of spi_buffer) +#define fs_volume (FATFS *)(((uint8_t*)(&spi_buffer[SPI_BUFFER_SIZE])) - sizeof(FATFS)) +// FatFS file object (at the end of spi_buffer) +#define fs_file ( FIL*)(((uint8_t*)(&spi_buffer[SPI_BUFFER_SIZE])) - sizeof(FATFS) - sizeof(FIL)) +// Filename object (at the end of spi_buffer) +#define fs_filename ( char*)(((uint8_t*)(&spi_buffer[SPI_BUFFER_SIZE])) - sizeof(FATFS) - sizeof(FIL) - FF_LFN_BUF - 4) +#endif void testLog(void); // debug log #endif diff --git a/ui.c b/ui.c index 92f2b81..1a71816 100644 --- a/ui.c +++ b/ui.c @@ -71,19 +71,6 @@ volatile uint8_t operation_requested = OP_NONE; int8_t previous_marker = MARKER_INVALID; -#ifdef __USE_SD_CARD__ -#if SPI_BUFFER_SIZE < 2048 -#error "SPI_BUFFER_SIZE for SD card support need size >= 2048" -#else -// Fat file system work area (at the end of spi_buffer) -static FATFS *fs_volume = (FATFS *)(((uint8_t*)(&spi_buffer[SPI_BUFFER_SIZE])) - sizeof(FATFS)); -// FatFS file object (at the end of spi_buffer) -static FIL *fs_file = ( FIL*)(((uint8_t*)(&spi_buffer[SPI_BUFFER_SIZE])) - sizeof(FATFS) - sizeof(FIL)); -// Filename object (at the end of spi_buffer) -static char *fs_filename = ( char*)(((uint8_t*)(&spi_buffer[SPI_BUFFER_SIZE])) - sizeof(FATFS) - sizeof(FIL) - FF_LFN_BUF - 4); -#endif -#endif - enum { UI_NORMAL, UI_MENU, UI_KEYPAD }; From d7e117988ce8e2f9fae1f2cc4cb5e3f82fc150d2 Mon Sep 17 00:00:00 2001 From: DiSlord Date: Wed, 26 May 2021 22:05:17 +0300 Subject: [PATCH 3/6] Add load config.ini script from sd card --- main.c | 263 +++++++++++++++++++++++------------------------------- nanovna.h | 2 + ui_sa.c | 13 +++ 3 files changed, 128 insertions(+), 150 deletions(-) diff --git a/main.c b/main.c index e68c254..8a19e99 100644 --- a/main.c +++ b/main.c @@ -799,7 +799,6 @@ VNA_SHELL_FUNCTION(cmd_sd_list) VNA_SHELL_FUNCTION(cmd_sd_read) { - FRESULT res; char *buf = (char *)spi_buffer; if (argc != 1) { @@ -815,21 +814,15 @@ VNA_SHELL_FUNCTION(cmd_sd_read) return; } // shell_printf("sd_read: %s\r\n", filename); - // number of bytes to follow (file size) - const uint32_t filesize = f_size(fs_file); + uint32_t filesize = f_size(fs_file); streamWrite(shell_stream, (void *)&filesize, 4); - + UINT size = 0; // file data (send all data from file) - while (1) - { - UINT size = 0; - res = f_read(fs_file, buf, 512, &size); - if (res != FR_OK || size == 0) - break; + while (f_read(fs_file, buf, 512, &size) == FR_OK && size > 0) streamWrite(shell_stream, (void *)buf, size); - } - res = f_close(fs_file); + + f_close(fs_file); return; } @@ -1903,43 +1896,67 @@ static void shell_init_connection(void){ } #endif +static const VNAShellCommand *VNAShell_parceLine(char *line){ + // Parse and execute line + char *lp = line, *ep; + shell_nargs = 0; + +// DEBUG_LOG(0, lp); // debug console log + while (*lp != 0) { + // Skipping white space and tabs at string begin. + while (*lp == ' ' || *lp == '\t') lp++; + // If an argument starts with a double quote then its delimiter is another quote, else + // delimiter is white space. + ep = (*lp == '"') ? strpbrk(++lp, "\"") : strpbrk(lp, " \t"); + // Store in args string + shell_args[shell_nargs++] = lp; + // Stop, end of input string + if ((lp = ep) == NULL) break; + // Argument limits check + if (shell_nargs > VNA_SHELL_MAX_ARGUMENTS) { + shell_printf("too many arguments, max " define_to_STR(VNA_SHELL_MAX_ARGUMENTS) "" VNA_SHELL_NEWLINE_STR); + return NULL; + } + // Set zero at the end of string and continue check + *lp++ = 0; + } + if (shell_nargs){ + const VNAShellCommand *scp; + for (scp = commands; scp->sc_name != NULL; scp++) + if (get_str_index(scp->sc_name, shell_args[0]) == 0) + return scp; + } + return NULL; +} + // // Read command line from shell_stream // static int VNAShell_readLine(char *line, int max_size) { - // Read line from input stream + // send backspace, space for erase, backspace again + char backspace[] = {0x08, 0x20, 0x08, 0x00}; uint8_t c; - char *ptr = line; // Prepare I/O for shell_stream PREPARE_STREAM; - while (1) { - // Return 0 only if stream not active - if (streamRead(shell_stream, &c, 1) == 0) - return 0; + uint16_t j = 0; + // Return 0 only if stream not active + while (streamRead(shell_stream, &c, 1)) { // Backspace or Delete - if (c == 8 || c == 0x7f) { - if (ptr != line) { - static const char backspace[] = {0x08, 0x20, 0x08, 0x00}; - shell_printf(backspace); - ptr--; - } + if (c == 0x08 || c == 0x7f) { + if (j > 0) {shell_printf(backspace); j--;} continue; } // New line (Enter) if (c == '\r') { shell_printf(VNA_SHELL_NEWLINE_STR); - *ptr = 0; + line[j] = 0; return 1; } - // Others (skip) - if (c < 0x20) - continue; - // Store - if (ptr < line + max_size - 1) { - streamPut(shell_stream, c); // Echo - *ptr++ = (char)c; - } + // Others (skip) or too long - skip + if (c < ' ' || j >= max_size - 1) continue; + streamPut(shell_stream, c); // Echo + line[j++] = (char)c; } return 0; } @@ -1949,57 +1966,76 @@ static int VNAShell_readLine(char *line, int max_size) // static void VNAShell_executeLine(char *line) { - // Parse and execute line - char *lp = line, *ep; - shell_nargs = 0; - while (*lp != 0) { - // Skipping white space and tabs at string begin. - while (*lp == ' ' || *lp == '\t') lp++; - // If an argument starts with a double quote then its delimiter is another quote, else - // delimiter is white space. - ep = (*lp == '"') ? strpbrk(++lp, "\"") : strpbrk(lp, " \t"); - // Store in args string - shell_args[shell_nargs++] = lp; - // Stop, end of input string - if ((lp = ep) == NULL) break; - // Argument limits check - if (shell_nargs > VNA_SHELL_MAX_ARGUMENTS) { - shell_printf("too many arguments, max " define_to_STR( - VNA_SHELL_MAX_ARGUMENTS) "" VNA_SHELL_NEWLINE_STR); - return; - } - // Set zero at the end of string and continue check - *lp++ = 0; - } - if (shell_nargs == 0) return; // Execute line - const VNAShellCommand *scp; - for (scp = commands; scp->sc_name != NULL; scp++) { - if (get_str_index(scp->sc_name, shell_args[0]) == 0) { - if (scp->flags & CMD_WAIT_MUTEX) { - shell_function = scp->sc_function; - operation_requested|=OP_CONSOLE; - // Wait execute command in sweep thread - do { - osalThreadSleepMilliseconds(100); - } while (shell_function); - } else { - operation_requested = false; // otherwise commands will be aborted - scp->sc_function(shell_nargs - 1, &shell_args[1]); - if (dirty) { - operation_requested = true; // ensure output is updated - if (MODE_OUTPUT(setting.mode)) - draw_menu(); // update screen if in output mode and dirty - else - redraw_request |= REDRAW_CAL_STATUS | REDRAW_AREA | REDRAW_FREQUENCY; - } + const VNAShellCommand *scp = VNAShell_parceLine(line); + if (scp) { + if (scp->flags & CMD_WAIT_MUTEX) { + shell_function = scp->sc_function; + operation_requested|=OP_CONSOLE; + // Wait execute command in sweep thread + do { + osalThreadSleepMilliseconds(10); + } while (shell_function); + } else { + operation_requested = false; // otherwise commands will be aborted + scp->sc_function(shell_nargs - 1, &shell_args[1]); + if (dirty) { + operation_requested = true; // ensure output is updated + if (MODE_OUTPUT(setting.mode)) + draw_menu(); // update screen if in output mode and dirty + else + redraw_request |= REDRAW_CAL_STATUS | REDRAW_AREA | REDRAW_FREQUENCY; } - return; } + return; } shell_printf("%s?" VNA_SHELL_NEWLINE_STR, shell_args[0]); } +#ifdef __SD_CARD_LOAD__ +#ifndef __USE_SD_CARD__ +#error "Need enable SD card support __USE_SD_CARD__ in nanovna.h, for use ENABLE_SD_CARD_CMD" +#endif +void sd_card_load_config(void){ + // Mount card + if (f_mount(fs_volume, "", 1) != FR_OK) + return; + + if (f_open(fs_file, "config.ini", FA_OPEN_EXISTING | FA_READ) != FR_OK) + return; + + char *buf = (char *)spi_buffer; + UINT size = 0; + + uint16_t j = 0, i; + while (f_read(fs_file, buf, 512, &size) == FR_OK && size > 0){ + i = 0; + while (i < size) { + uint8_t c = buf[i++]; + // New line (Enter) + if (c == '\r') { +// shell_line[j ] = '\r'; +// shell_line[j+1] = '\n'; +// shell_line[j+2] = 0; +// shell_printf(shell_line); + shell_line[j] = 0; j = 0; + const VNAShellCommand *scp = VNAShell_parceLine(shell_line); +// if (scp && (scp->flags&CMD_RUN_IN_LOAD)) !!! FIX me, add this flag to commands + scp->sc_function(shell_nargs - 1, &shell_args[1]); + continue; + } + // Others (skip) + if (c < 0x20) continue; + // Store + if (j < VNA_SHELL_MAX_LENGTH - 1) + shell_line[j++] = (char)c; + } + } + f_close(fs_file); + return; +} +#endif + #ifdef VNA_SHELL_THREAD static THD_WORKING_AREA(waThread2, /* cmd_* max stack size + alpha */442); THD_FUNCTION(myshellThread, p) @@ -2017,26 +2053,6 @@ THD_FUNCTION(myshellThread, p) } #endif -#ifdef __VNA__ -// I2C clock bus setting: depend from STM32_I2C1SW in mcuconf.h -static const I2CConfig i2ccfg = { - .timingr = STM32_TIMINGR_PRESC(0U) | /* 72MHz I2CCLK. ~ 600kHz i2c */ -// STM32_TIMINGR_SCLDEL(10U) | STM32_TIMINGR_SDADEL(4U) | -// STM32_TIMINGR_SCLH(31U) | STM32_TIMINGR_SCLL(79U), - - STM32_TIMINGR_SCLDEL(15U) | STM32_TIMINGR_SDADEL(15U) | - STM32_TIMINGR_SCLH(35U) | STM32_TIMINGR_SCLL(85U), - -// STM32_TIMINGR_SCLDEL(15U) | STM32_TIMINGR_SDADEL(15U) | -// STM32_TIMINGR_SCLH(35U) | STM32_TIMINGR_SCLL(55U), - -// STM32_TIMINGR_SCLDEL(10U) | STM32_TIMINGR_SDADEL(4U) | -// STM32_TIMINGR_SCLH(48U) | STM32_TIMINGR_SCLL(90U), - .cr1 = 0, - .cr2 = 0 -}; -#endif - static const DACConfig dac1cfg1 = { init: 0, datamode: DAC_DHRM_12BIT_RIGHT @@ -2058,59 +2074,6 @@ void my_microsecond_delay(int t) if (t>1) gptPolledDelay(&GPTD14, t); // t us delay #endif } -#if 0 -/* - * UART driver configuration structure. - */ -static UARTConfig uart_cfg_1 = { - NULL, //txend1, - NULL, //txend2, - NULL, //rxend, - NULL, //rxchar, - NULL, //rxerr, - 800000, - 0, - 0, //USART_CR2_LINEN, - 0 -}; -#endif - -#if 0 -static const SerialConfig LCD_config = -{ - 9600, - 0, - USART_CR2_STOP2_BITS, - 0 -}; - - -void myWrite(char *buf) -{ - int len = strlen(buf); - while(len-- > 0) { - sdPut(&SD1,*buf++); - osalThreadSleepMicroseconds(1000); - } -} - -static int serial_count = 0; -int mySerialReadline(unsigned char *buf, int len) -{ - int i; - do { - i = sdReadTimeout(&SD1,&buf[serial_count], 20-serial_count,TIME_IMMEDIATE); - serial_count += i; - if (i > 0) - osalThreadSleepMicroseconds(1000); - } while (serial_count < len && i > 0); - if (buf[serial_count-1] == '\n') { - serial_count = 0; - return(i); - } else - return 0; -} -#endif /* Main thread stack size defined in makefile USE_PROCESS_STACKSIZE = 0x200 * Profile stack usage (enable threads command by def ENABLE_THREADS_COMMAND) show: diff --git a/nanovna.h b/nanovna.h index a63079a..d7f2db8 100644 --- a/nanovna.h +++ b/nanovna.h @@ -80,6 +80,7 @@ #ifdef TINYSA4 #define __USE_RTC__ // Enable RTC clock #define __USE_SD_CARD__ // Enable SD card support +#define __SD_CARD_LOAD__ // Allow run commands from SD card (config.ini in root) #define __LCD_BRIGHTNESS__ // LCD or hardware allow change brightness, add menu item for this #define __HARMONIC__ #define __VBW__ @@ -1335,6 +1336,7 @@ bool SD_Inserted(void); #define fs_filename ( char*)(((uint8_t*)(&spi_buffer[SPI_BUFFER_SIZE])) - sizeof(FATFS) - sizeof(FIL) - FF_LFN_BUF - 4) #endif void testLog(void); // debug log +void sd_card_load_config(void); #endif /* diff --git a/ui_sa.c b/ui_sa.c index 883f54d..b9c11b8 100644 --- a/ui_sa.c +++ b/ui_sa.c @@ -780,6 +780,16 @@ static UI_FUNCTION_ADV_CALLBACK(menu_store_preset_acb) menu_move_back(true); } +#ifdef __SD_CARD_LOAD__ +UI_FUNCTION_CALLBACK(menu_load_config_cb) +{ + (void)item; + (void)data; + sd_card_load_config(); + ui_mode_normal(); +} +#endif + UI_FUNCTION_CALLBACK(menu_autosettings_cb) { (void)item; @@ -2476,6 +2486,9 @@ static const menuitem_t menu_settings4[] = { MT_KEYPAD, KM_COR_AM, "COR\nAM", "Enter AM modulation correction"}, { MT_KEYPAD, KM_COR_WFM, "COR\nWFM", "Enter WFM modulation correction"}, { MT_KEYPAD, KM_COR_NFM, "COR\nNFM", "Enter NFM modulation correction"}, +#endif +#ifdef __SD_CARD_LOAD__ + { MT_CALLBACK, 0 , "LOAD\nCONFIG", menu_load_config_cb}, #endif { MT_CALLBACK, 0 , "CLEAR\nCONFIG", menu_clearconfig_cb}, #ifdef __HARMONIC__ From 6924b21edc7811419faeddbdf031c17fd4e6d244 Mon Sep 17 00:00:00 2001 From: DiSlord Date: Sun, 16 May 2021 16:32:20 +0300 Subject: [PATCH 4/6] Cleanup draw_cal_status code, use lcd_printf --- ui_sa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui_sa.c b/ui_sa.c index b9c11b8..1db8f2f 100644 --- a/ui_sa.c +++ b/ui_sa.c @@ -3368,7 +3368,7 @@ redraw_cal_status: // if (setting.mode == M_LOW) { // Attenuation - ili9341_set_foreground(setting.auto_attenuation ? LCD_FG_COLOR : LCD_BRIGHT_COLOR_GREEN); + ili9341_set_foreground(setting.auto_attenuation ? LCD_BRIGHT_COLOR_GREEN : LCD_FG_COLOR); lcd_printf(x, y, "Atten:\n%4.2FdB", get_attenuation()); y = add_quick_menu(y+= YSTEP, (menuitem_t *)menu_atten); // } From 6277880e7347e11c6da4feed60c22289d27201fc Mon Sep 17 00:00:00 2001 From: erikkaashoek Date: Wed, 26 May 2021 15:53:53 +0200 Subject: [PATCH 5/6] Revert "Cleanup draw_cal_status code, use lcd_printf" This reverts commit a647621233626bce571d06e03b0151de13fa3a76. --- ui_sa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui_sa.c b/ui_sa.c index 1db8f2f..b9c11b8 100644 --- a/ui_sa.c +++ b/ui_sa.c @@ -3368,7 +3368,7 @@ redraw_cal_status: // if (setting.mode == M_LOW) { // Attenuation - ili9341_set_foreground(setting.auto_attenuation ? LCD_BRIGHT_COLOR_GREEN : LCD_FG_COLOR); + ili9341_set_foreground(setting.auto_attenuation ? LCD_FG_COLOR : LCD_BRIGHT_COLOR_GREEN); lcd_printf(x, y, "Atten:\n%4.2FdB", get_attenuation()); y = add_quick_menu(y+= YSTEP, (menuitem_t *)menu_atten); // } From e00259094f501ea0024cccfd3f3e922d30986147 Mon Sep 17 00:00:00 2001 From: DiSlord Date: Wed, 26 May 2021 22:09:19 +0300 Subject: [PATCH 6/6] Add CMD_RUN_IN_LOAD define --- main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/main.c b/main.c index 8a19e99..a978549 100644 --- a/main.c +++ b/main.c @@ -1640,6 +1640,7 @@ typedef struct { // Some commands can executed only in sweep thread, not in main cycle #define CMD_WAIT_MUTEX 1 +#define CMD_RUN_IN_LOAD 2 static const VNAShellCommand commands[] = { {"version" , cmd_version , 0},