kopia lustrzana https://github.com/dl9rdz/rdz_ttgo_sonde
enable/disable norx_timeout via config.txt
rodzic
c96f4812e9
commit
25ea6876cf
|
@ -22,9 +22,6 @@
|
|||
#include "geteph.h"
|
||||
#include "rs92gps.h"
|
||||
|
||||
#define DISABLE_SX1278
|
||||
#define DISABLE_MAINRX
|
||||
|
||||
int e;
|
||||
|
||||
enum MainState { ST_DECODER, ST_SPECTRUM, ST_WIFISCAN, ST_UPDATE, ST_TOUCHCALIB };
|
||||
|
@ -455,6 +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},
|
||||
{"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},
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#button2_pin=255
|
||||
#button2_axp=0
|
||||
# LED port
|
||||
led_pout=9
|
||||
#led_pout=-1
|
||||
# OLED Setup is depending on hardware of LoRa board
|
||||
# TTGO v1: SDA=4 SCL=15, RST=16
|
||||
# TTGO v2: SDA=21 SCL=22, RST=16
|
||||
|
@ -46,12 +46,14 @@ 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)
|
||||
norx_timeout=20
|
||||
#-------------------------------#
|
||||
# Spectrum display settings
|
||||
#-------------------------------#
|
||||
startfreq=400
|
||||
channelbw=10
|
||||
spectrum=10
|
||||
spectrum=-1 #10
|
||||
noisefloor=-125
|
||||
marker=1
|
||||
#-------------------------------#
|
||||
|
|
|
@ -127,7 +127,7 @@ timeaction=#,D,+
|
|||
# (norx timer: if no signal for >20 seconds: go back to scanner mode)
|
||||
#
|
||||
@Legacy
|
||||
timer=-1,-1,20000
|
||||
timer=-1,-1,N
|
||||
key1action=+,0,F,W
|
||||
key2action=>,#,#,#
|
||||
timeaction=#,#,0
|
||||
|
@ -147,7 +147,7 @@ timeaction=#,#,0
|
|||
# Configuratoon for "Field" display (display 2)
|
||||
# similar to @Legacy, but no norx timer, and Key2 goes to display 4
|
||||
@Field
|
||||
timer=-1,-1,-1
|
||||
timer=-1,-1,N
|
||||
key1action=+,0,F,W
|
||||
key2action=>,#,#,#
|
||||
timeaction=#,#,#
|
||||
|
@ -163,7 +163,7 @@ timeaction=#,#,#
|
|||
# Configuration for "Field2" display (display 3)
|
||||
# similar to @Field
|
||||
@Field2
|
||||
timer=-1,-1,-1
|
||||
timer=-1,-1,N
|
||||
key1action=+,0,F,W
|
||||
key2action=>,#,#,#
|
||||
timeaction=#,#,#
|
||||
|
@ -218,7 +218,7 @@ fonts=5,6
|
|||
|
||||
############
|
||||
@MainTFT
|
||||
timer=-1,-1,20000
|
||||
timer=-1,-1,N
|
||||
key1action=+,0,F,W
|
||||
key2action=>,#,#,#
|
||||
timeaction=#,#,0
|
||||
|
@ -244,7 +244,7 @@ color=FFFFFF
|
|||
|
||||
############
|
||||
@PeilungTFT
|
||||
timer=-1,-1,20000
|
||||
timer=-1,-1,N
|
||||
key1action=+,0,F,W
|
||||
key2action=>,#,#,#
|
||||
timeaction=#,#,#
|
||||
|
@ -266,7 +266,7 @@ color=ffffff,000000
|
|||
|
||||
############
|
||||
@GPSdataTFT
|
||||
timer=-1,-1,20000
|
||||
timer=-1,-1,N
|
||||
key1action=+,0,F,W
|
||||
key2action=>,#,#,#
|
||||
timeaction=#,#,#
|
||||
|
@ -282,7 +282,7 @@ timeaction=#,#,#
|
|||
|
||||
############
|
||||
@BatteryTFT
|
||||
timer=-1,-1,20000
|
||||
timer=-1,-1,-1
|
||||
key1action=+,0,F,W
|
||||
key2action=>,#,#,#
|
||||
timeaction=#,#,#
|
||||
|
@ -300,7 +300,7 @@ timeaction=#,#,#
|
|||
|
||||
############
|
||||
@BatteryOLED
|
||||
timer=-1,-1,20000
|
||||
timer=-1,-1,-1
|
||||
key1action=+,0,F,W
|
||||
key2action=>,#,#,#
|
||||
timeaction=#,#,#
|
||||
|
@ -350,10 +350,10 @@ color=6C757D
|
|||
|
||||
############
|
||||
@Decode/General.TFT.Bazjo
|
||||
timer=-1,-1,20000
|
||||
timer=-1,-1,N
|
||||
key1action=+,0,F,W
|
||||
key2action=>,#,#,#
|
||||
timeaction=#,#,#
|
||||
timeaction=#,#,0
|
||||
scale=11,10
|
||||
fonts=0,2
|
||||
#Row 1
|
||||
|
@ -387,9 +387,9 @@ color=639AFF
|
|||
7,11=Vm/s
|
||||
#Row 4
|
||||
color=99004A
|
||||
9,0=xDistance
|
||||
9,0=xAltitude
|
||||
color=FF007B
|
||||
10,0=GD
|
||||
10,0=A
|
||||
color=99004A
|
||||
9,11=xBearing
|
||||
color=FF007B
|
||||
|
@ -411,7 +411,7 @@ color=6C757D
|
|||
|
||||
############
|
||||
@Decode/Battery.TFT.Bazjo
|
||||
timer=-1,-1,20000
|
||||
timer=-1,-1,N
|
||||
key1action=+,0,F,W
|
||||
key2action=>,#,#,#
|
||||
timeaction=#,#,#
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const char *version_name = "rdzTTGOsonde";
|
||||
const char *version_id = "devel20200131";
|
||||
const char *version_id = "devel20200209";
|
||||
const int SPIFFS_MAJOR=2;
|
||||
const int SPIFFS_MINOR=3;
|
||||
const int SPIFFS_MINOR=4;
|
||||
|
|
|
@ -832,7 +832,12 @@ void Display::initFromFile() {
|
|||
break;
|
||||
default: // parse content... (additional data or line `what`)
|
||||
if(strncmp(s,"timer=",6)==0) { // timer values
|
||||
sscanf(s+6, "%hd,%hd,%hd", newlayouts[idx].timeouts, newlayouts[idx].timeouts+1, newlayouts[idx].timeouts+2);
|
||||
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);
|
||||
newlayouts[idx].timeouts[0] = (*t1=='n'||*t1=='N')?sonde.config.norx_timeout:atoi(t1);
|
||||
newlayouts[idx].timeouts[1] = (*t2=='n'||*t1=='N')?sonde.config.norx_timeout:atoi(t2);
|
||||
newlayouts[idx].timeouts[2] = (*t3=='n'||*t1=='N')?sonde.config.norx_timeout:atoi(t3);
|
||||
//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
|
||||
char c1,c2,c3,c4;
|
||||
|
|
|
@ -68,7 +68,7 @@ void Sonde::defaultConfig() {
|
|||
sondeList = (SondeInfo *)malloc((MAXSONDE+1)*sizeof(SondeInfo));
|
||||
memset(sondeList, 0, (MAXSONDE+1)*sizeof(SondeInfo));
|
||||
config.touch_thresh = 70;
|
||||
config.led_pout = 9;
|
||||
config.led_pout = -1;
|
||||
config.power_pout = -1;
|
||||
config.spectrum=10;
|
||||
// Try autodetecting board type
|
||||
|
@ -79,6 +79,7 @@ void Sonde::defaultConfig() {
|
|||
config.disptype = 0;
|
||||
config.tft_orient = 1;
|
||||
config.button2_axp = 0;
|
||||
config.norx_timeout = 20;
|
||||
if(initlevels[16]==0) {
|
||||
config.oled_sda = 4;
|
||||
config.oled_scl = 15;
|
||||
|
@ -256,6 +257,8 @@ void Sonde::setConfig(const char *cfg) {
|
|||
Serial.printf("appending value %d next is %s\n", config.display[i-1], val?val:"");
|
||||
}
|
||||
config.display[i] = -1;
|
||||
} else if (strcmp(cfg, "norx_timeout")==0) {
|
||||
config.norx_timeout = atoi(val);
|
||||
} else if(strcmp(cfg,"startfreq")==0) {
|
||||
config.startfreq = atoi(val);
|
||||
} else if(strcmp(cfg,"channelbw")==0) {
|
||||
|
|
Ładowanie…
Reference in New Issue