noch ein versuch es richtig zu machen :)

This commit is contained in:
Hansi, dl9rdz 2020-02-09 22:01:42 +01:00
parent b5d7af6445
commit a28042da3d
4 changed files with 10 additions and 6 deletions

View File

@ -452,7 +452,7 @@ struct st_configitems config_list[] = {
/* Hardware dependeing settings */ /* Hardware dependeing settings */
{"", "Hardware configuration (requires reboot)", -5, NULL}, {"", "Hardware configuration (requires reboot)", -5, NULL},
{"disptype", "Display type (0=OLED/SSD1306, 1=TFT/ILI9225, 2=OLED/SH1106)", 0, &sonde.config.disptype}, {"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_sda", "OLED SDA/TFT SDA", 0, &sonde.config.oled_sda},
{"oled_scl", "OLED SCL/TFT CLK", 0, &sonde.config.oled_scl}, {"oled_scl", "OLED SCL/TFT CLK", 0, &sonde.config.oled_scl},
{"oled_rst", "OLED RST/TFT RST (needs reboot)", 0, &sonde.config.oled_rst}, {"oled_rst", "OLED RST/TFT RST (needs reboot)", 0, &sonde.config.oled_rst},

View File

@ -46,7 +46,7 @@ kisstnc.active = 1
# second entry: default "Receiver" display # second entry: default "Receiver" display
# additional entries: alternative receiver display, activated by button # additional entries: alternative receiver display, activated by button
display=0,1,2,3,4 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 norx_timeout=20
#-------------------------------# #-------------------------------#
# Spectrum display settings # Spectrum display settings

View File

@ -116,7 +116,7 @@ timeaction=#,D,+
############ ############
# Default configuration for "Legacy" display: # 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 # => norx timer fires after not receiving a singla for 20 seconds
# - key1 actions: +,0,F,W # - key1 actions: +,0,F,W
# => Button1 press: next sonde; double press => @Scanner display # => Button1 press: next sonde; double press => @Scanner display

View File

@ -835,9 +835,13 @@ void Display::initFromFile() {
char t1[10],t2[10],t3[10]; 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); 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); 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[0] = (*t1=='n'||*t1=='N')?sonde.config.norx_timeout:atoi(t1);
newlayouts[idx].timeouts[1] = (*t2=='n'||*t2=='N')?sonde.config.norx_timeout*1000:atoi(t2); 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*1000:atoi(t3); 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); //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]); 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 } else if(strncmp(s, "key1action=",11)==0) { // key 1 actions