diff --git a/RX_FSK/RX_FSK.ino b/RX_FSK/RX_FSK.ino index 6773195..7edcbca 100644 --- a/RX_FSK/RX_FSK.ino +++ b/RX_FSK/RX_FSK.ino @@ -452,7 +452,7 @@ struct st_configitems config_list[] = { /* Hardware dependeing settings */ {"", "Hardware configuration (requires reboot)", -5, NULL}, {"disptype", "Display type (0=OLED/SSD1306, 1=TFT/ILI9225, 2=OLED/SH1106)", 0, &sonde.config.disptype}, - {"norx_timeout", "No-RX-Timeout (-1=disabled)", 0, &sonde.config.norx_timeout}, + {"norx_timeout", "No-RX-Timeout in seconds (-1=disabled)", 0, &sonde.config.norx_timeout}, {"oled_sda", "OLED SDA/TFT SDA", 0, &sonde.config.oled_sda}, {"oled_scl", "OLED SCL/TFT CLK", 0, &sonde.config.oled_scl}, {"oled_rst", "OLED RST/TFT RST (needs reboot)", 0, &sonde.config.oled_rst}, diff --git a/RX_FSK/data/config.txt b/RX_FSK/data/config.txt index f2976b0..fcd6df0 100644 --- a/RX_FSK/data/config.txt +++ b/RX_FSK/data/config.txt @@ -46,7 +46,7 @@ kisstnc.active = 1 # second entry: default "Receiver" display # additional entries: alternative receiver display, activated by button display=0,1,2,3,4 -# set to -1 to disable (used for "N" values in timers in screens.txt) +# set to -1 to disable (used for "N" values in timers in screens.txt). Value in seconds norx_timeout=20 #-------------------------------# # Spectrum display settings diff --git a/RX_FSK/data/screens.txt b/RX_FSK/data/screens.txt index dd74b29..b7d3bb4 100644 --- a/RX_FSK/data/screens.txt +++ b/RX_FSK/data/screens.txt @@ -116,7 +116,7 @@ timeaction=#,D,+ ############ # Default configuration for "Legacy" display: -# - view timer=-1, rx timer=-1 (disabled); norx timer=20000 (or -1 for "old" behaviour) +# - view timer=-1, rx timer=-1 (disabled); norx timer=20 (or -1 for "old" behaviour) # => norx timer fires after not receiving a singla for 20 seconds # - key1 actions: +,0,F,W # => Button1 press: next sonde; double press => @Scanner display diff --git a/libraries/SondeLib/Display.cpp b/libraries/SondeLib/Display.cpp index 91a174b..1bc0a4d 100644 --- a/libraries/SondeLib/Display.cpp +++ b/libraries/SondeLib/Display.cpp @@ -835,9 +835,13 @@ void Display::initFromFile() { char t1[10],t2[10],t3[10]; sscanf(s+6, "%5[0-9a-zA-Z-] , %5[0-9a-zA-Z-] , %5[0-9a-zA-Z-]", t1, t2, t3); Serial.printf("timers are %s, %s, %s\n", t1, t2, t3); - newlayouts[idx].timeouts[0] = (*t1=='n'||*t1=='N')?sonde.config.norx_timeout*1000:atoi(t1); - newlayouts[idx].timeouts[1] = (*t2=='n'||*t2=='N')?sonde.config.norx_timeout*1000:atoi(t2); - newlayouts[idx].timeouts[2] = (*t3=='n'||*t3=='N')?sonde.config.norx_timeout*1000:atoi(t3); + newlayouts[idx].timeouts[0] = (*t1=='n'||*t1=='N')?sonde.config.norx_timeout:atoi(t1); + newlayouts[idx].timeouts[1] = (*t2=='n'||*t2=='N')?sonde.config.norx_timeout:atoi(t2); + newlayouts[idx].timeouts[2] = (*t3=='n'||*t3=='N')?sonde.config.norx_timeout:atoi(t3); + // Code later assumes milliseconds, but config.txt and screens.txt use values in seconds + if(newlayouts[idx].timeouts[0]>0) newlayouts[idx].timeouts[0]*=1000; + if(newlayouts[idx].timeouts[1]>0) newlayouts[idx].timeouts[1]*=1000; + if(newlayouts[idx].timeouts[2]>0) newlayouts[idx].timeouts[2]*=1000; //sscanf(s+6, "%hd,%hd,%hd", newlayouts[idx].timeouts, newlayouts[idx].timeouts+1, newlayouts[idx].timeouts+2); Serial.printf("timer values: %d, %d, %d\n", newlayouts[idx].timeouts[0], newlayouts[idx].timeouts[1], newlayouts[idx].timeouts[2]); } else if(strncmp(s, "key1action=",11)==0) { // key 1 actions