wifi, take 2

This commit is contained in:
Hansi, dl9rdz 2024-09-05 23:47:51 +00:00
parent fbacdaafbb
commit f4e806011b
3 changed files with 860 additions and 867 deletions

View File

@ -2454,11 +2454,16 @@ void WiFiEvent(WiFiEvent_t event)
//wifi_state = WIFI_DISABLED;
//%WiFi.disconnect(true);
// lets try somethign else:
WiFi.reconnect();
/// This is not a good idea, lets check what if we do nothing: WiFi.reconnect();
Serial.println("WiFi State was connect");
break;
}
Serial.printf("Turning off (state is %d)\n", wifi_state);
WiFi.mode(WIFI_MODE_NULL);
break;
case ARDUINO_EVENT_WIFI_OFF:
Serial.println("WiFi is OFF");
break;
case ARDUINO_EVENT_WIFI_STA_AUTHMODE_CHANGE:
Serial.println("Authentication mode of access point has changed");
break;
@ -2750,6 +2755,8 @@ void loopWifiScan() {
disp.rdis->drawString(0, lastl, "Conn:");
disp.rdis->drawString(6 * dispxs, lastl, fetchWifiSSID(index));
// TODO: wifi_state is used inconsistently
wifi_state = WIFI_CONNECT;
WiFi.begin(fetchWifiSSID(index), fetchWifiPw(index));
} else {
abort = 2; // no network found in scan => abort right away

View File

@ -1,4 +1,8 @@
#include "../features.h"
#define TAG "Display"
#include "logger.h"
#include <U8x8lib.h>
#include <U8g2lib.h>
#include <MicroNMEA.h>
@ -265,22 +269,21 @@ static const uint8_t *fl[] = {
void U8x8Display::begin() {
Serial.printf("Init SSD1306 display %d %d %d\n", sonde.config.oled_scl, sonde.config.oled_sda, sonde.config.oled_rst);
//u8x8 = new U8X8_SSD1306_128X64_NONAME_SW_I2C(/* clock=*/ sonde.config.oled_scl, /* data=*/ sonde.config.oled_sda, /* reset=*/ sonde.config.oled_rst); // Unbuffered, basic graphics, software I2C
LOG_I(TAG, "Init SSD1306 display scl=%d sda=%d rst=%d\n", sonde.config.oled_scl, sonde.config.oled_sda, sonde.config.oled_rst);
if (_type==2) {
u8x8 = new U8X8_SH1106_128X64_NONAME_HW_I2C(/* reset=*/ sonde.config.oled_rst, /* clock=*/ sonde.config.oled_scl, /* data=*/ sonde.config.oled_sda); // Unbuffered, basic graphics, software I2C
u8x8 = new U8X8_SH1106_128X64_NONAME_HW_I2C(/* reset=*/ sonde.config.oled_rst, /* clock=*/ sonde.config.oled_scl, /* data=*/ sonde.config.oled_sda);
} else { //__type==0 or anything else
u8x8 = new U8X8_SSD1306_128X64_NONAME_HW_I2C(/* reset=*/ sonde.config.oled_rst, /* clock=*/ sonde.config.oled_scl, /* data=*/ sonde.config.oled_sda); // Unbuffered, basic graphics, software I2C
u8x8 = new U8X8_SSD1306_128X64_NONAME_HW_I2C(/* reset=*/ sonde.config.oled_rst, /* clock=*/ sonde.config.oled_scl, /* data=*/ sonde.config.oled_sda);
}
Serial.println("calling begin..");
LOG_D(TAG, "calling begin...\n");
u8x8->begin();
Serial.println("setup finishing...");
if(sonde.config.tft_orient==3) u8x8->setFlipMode(true);
if(sonde.config.dispcontrast>=0) u8x8->setContrast(sonde.config.dispcontrast);
LOG_D(TAG, "setup finishing...\n");
fontlist = fl;
nfonts = sizeof(fl)/sizeof(uint8_t *);
Serial.printf("Size of font list is %d\n", nfonts);
LOG_I(TAG, "Size of font list is %d\n", nfonts);
}
void U8x8Display::clear() {
@ -414,27 +417,27 @@ static void init_gfx_fonts() {
part = esp_partition_find_first(ESP_PARTITION_TYPE_ANY, ESP_PARTITION_SUBTYPE_ANY, "fonts");
if(part) {
Serial.printf("FONT partition found, size is %d!", part->size);
LOG_I(TAG, "FONT partition found, size is %d!", part->size);
err = esp_partition_mmap(part, 0, part->size, ESP_PARTITION_MMAP_DATA, (const void **)&data, &handle);
if( err != ESP_OK ) {
Serial.println("mmap not OK\n");
LOG_E(TAG, "mmap of font partition failed\n");
return;
}
Serial.println("font partition successfully mmaped");
LOG_D(TAG, "font partition successfully mmaped\n");
// do relocation stuff....
const GFXfont **fptr = (const GFXfont **)data;
if((uint32_t)*fptr != 0x544E4F46) { // FONT
Serial.println("No font data in font partition");
LOG_E(TAG, "No font data in font partition\n");
return;
}
fptr++;
int n=0;
for(const GFXfont **g=fptr; *g!=NULL; g++) { Serial.printf("fptr=%p *=%p\n", g, *g); n++; }
Serial.printf("There a %d fonts in the font partition\n", n);
for(const GFXfont **g=fptr; *g!=NULL; g++) { LOG_I(TAG, "fptr=%p *=%p\n", g, *g); n++; }
LOG_I(TAG, "There a %d fonts in the font partition\n", n);
if(n>MAXFONT) n=MAXFONT;
GFXfont **newgfl = (GFXfont **)malloc( n*sizeof(GFXfont) + MAXFONT*sizeof(GFXfont *) );
if(!newgfl) {
Serial.println("no memory for gfx fonts");
LOG_E(TAG, "no memory for gfx fonts");
return;
}
GFXfont *fonts = (GFXfont *)(((char *)newgfl) + MAXFONT*sizeof(GFXfont *));
@ -442,17 +445,16 @@ static void init_gfx_fonts() {
for(int i=0; i<n; i++) {
newgfl[i] = fonts+i;
GFXfont *orig = (GFXfont *)(((char *)data) + (uint32_t)fptr[i]);
printf("data is %p, orig = %p\n", data, orig);
memcpy(newgfl[i], orig, sizeof(GFXfont));
newgfl[i]->bitmap = newgfl[i]->bitmap + (uint32_t)data; // relocate bitmap pointer to mmap partition
newgfl[i]->glyph = (GFXglyph *)( ((char *)newgfl[i]->glyph) + (uint32_t)data );
Serial.printf("font %d: gfl[i] is %p, gfl[i]->bitmap is %p, gfl[i]->glyph is %p\n", i, newgfl[i], newgfl[i]->bitmap, newgfl[i]->glyph);
Serial.printf(" font data: first=%d, last=%d, yAdv=%d\n", newgfl[i]->first, newgfl[i]->last, newgfl[i]->yAdvance);
LOG_D(TAG, "font %d: gfl[i] is %p, gfl[i]->bitmap is %p, gfl[i]->glyph is %p\n", i, newgfl[i], newgfl[i]->bitmap, newgfl[i]->glyph);
LOG_D(TAG, " font data: first=%d, last=%d, yAdv=%d\n", newgfl[i]->first, newgfl[i]->last, newgfl[i]->yAdvance);
}
gfl = (const GFXfont **)newgfl;
ngfx = n;
} else {
Serial.println("FATAL ERROR: NO FONT PARTITION FOUND\n");
LOG_E(TAG, "FATAL ERROR: NO FONT PARTITION FOUND\n");
while(1);
}
}
@ -504,18 +506,15 @@ void calc_gfx_offsets() {
Arduino_DataBus *bus;
void ILI9225Display::begin() {
Serial.println("ILI9225/ILI9341 init");
LOG_I(TAG, "TFT display (ILI9225/ILI9341/ILI9342/ST7789) init\n");
init_gfx_fonts();
calc_gfx_offsets();
// On the M5, the display and the Lora chip are on the same SPI interface (VSPI default pins),
// we must use the same SPI bus with correct locking
// TODO: Check why there is a hard-coded 38 in here!?!?!?
if(sonde.config.type == TYPE_M5_CORE2) {
// The bus init also must use the same miso as the sx1278 (even if we don't use miso at all for the display)
if(sonde.config.type == TYPE_M5_CORE2 || sonde.config.type == TYPE_M5_CORE ) {
bus = new Arduino_ESP32SPI( sonde.config.tft_rs, sonde.config.tft_cs,
sonde.config.oled_scl, sonde.config.oled_sda, 38, VSPI);
} else if(sonde.config.type == TYPE_M5_CORE2 || sonde.config.type == TYPE_M5_CORE) {
bus = new Arduino_ESP32SPI( sonde.config.tft_rs, sonde.config.tft_cs,
sonde.config.oled_scl, sonde.config.oled_sda, 19, VSPI);
sonde.config.oled_scl, sonde.config.oled_sda, sonde.config.sx1278_miso, VSPI);
} else {
bus = new Arduino_ESP32SPI( sonde.config.tft_rs, sonde.config.tft_cs,
sonde.config.oled_scl, sonde.config.oled_sda, -1, HSPI);
@ -528,13 +527,13 @@ void ILI9225Display::begin() {
tft = new Arduino_ST7789(bus, sonde.config.oled_rst);
else
tft = new Arduino_ILI9225(bus, sonde.config.oled_rst);
Serial.println("ILI9225/ILI9341/ST7789 init: done");
tft->begin(sonde.config.tft_spifreq);
tft->fillScreen(BLACK);
tft->setRotation(sonde.config.tft_orient);
tft->setTextWrap(false);
if(sonde.config.type == TYPE_M5_CORE2||sonde.config.type==TYPE_M5_CORE)
tft->invertDisplay(true);
LOG_D(TAG, "TFT init: done\n");
}
void ILI9225Display::clear() {
@ -582,7 +581,7 @@ void ILI9225Display::getDispSize(uint8_t *height, uint8_t *width, uint8_t *lines
if(lineskip) *lineskip = h+2;
tft->getTextBounds("A", 0, 0, &x, &y, &w, &h);
if(colskip) *colskip = w+2;
if(lineskip&&colskip) { Serial.printf("skip size from bounds: %d, %d\n", *lineskip, *colskip); }
if(lineskip&&colskip) { LOG_I(TAG, "skip size from bounds: %d, %d\n", *lineskip, *colskip); }
}
}
}
@ -675,8 +674,8 @@ void ILI9225Display::drawString(uint16_t x, uint16_t y, const char *s, int16_t w
uint16_t height = gfxoffsets[findex-1].yclear;
uint16_t *bitmap = (uint16_t *)malloc(sizeof(uint16_t) * width * height);
if(!bitmap) {
Serial.println("FATAL: OUT OF MEMORY when allocating bitmap");
Serial.printf("w=%d, h=%d, s==%d\n",width, height, 2*width*height);
LOG_E(TAG, "FATAL: OUT OF MEMORY when allocating bitmap\n");
LOG_E(TAG, "w=%d, h=%d, s==%d\n",width, height, 2*width*height);
heap_caps_print_heap_info(MALLOC_CAP_DEFAULT);
return;
}
@ -788,16 +787,16 @@ RawDisplay *Display::rdis = NULL;
//TODO: maybe merge with initFromFile later?
void Display::init() {
Serial.printf("disptype is %d\n",sonde.config.disptype);
LOG_I(TAG, "init: disptype is %d\n",sonde.config.disptype);
if(sonde.config.disptype==0 || sonde.config.disptype==2) {
rdis = new U8x8Display(sonde.config.disptype);
} else {
rdis = new ILI9225Display(sonde.config.disptype);
}
Serial.println("Display created");
LOG_D(TAG, "Display created\n");
rdis->begin();
delay(100);
Serial.println("Display initialized");
LOG_D(TAG, "Display initialized\n");
rdis->clear();
dispstate = 1; // display active by default
}
@ -819,7 +818,7 @@ void Display::replaceLayouts(DispInfo *newlayouts, int nnew) {
DispInfo *old = layouts;
// assign new layouts and current layout
Serial.printf("replaceLayouts: idx=%d n(new)=%d\n", layoutIdx, nLayouts);
LOG_I(TAG, "replaceLayouts: idx=%d n(new)=%d\n", layoutIdx, nLayouts);
layouts = newlayouts;
nLayouts = nnew;
if(layoutIdx >= nLayouts) layoutIdx = 0;
@ -853,7 +852,7 @@ int Display::allocDispInfo(int entries, DispInfo *d, char *label)
d->timeouts = (int16_t *)mem;
d->label = label;
Serial.printf("%s: alloc %d bytes (%d entries) for %p (addr=%p)\n", label, totalsize, entries, d, d->de);
LOG_I(TAG, "%s: alloc %d bytes (%d entries) for %p (addr=%p)\n", label, totalsize, entries, d, d->de);
return 0;
}
@ -914,7 +913,6 @@ void Display::parseDispElement(char *text, DispEntry *de)
case 'f':
de->func = disp.drawFreq;
de->extra = strdup(text+1);
//Serial.printf("parsing 'f' entry: extra is '%s'\n", de->extra);
break;
case 'm':
de->func = disp.drawTelemetry;
@ -973,7 +971,6 @@ void Display::parseDispElement(char *text, DispEntry *de)
de->extra = (char *)circinfo;
} else {
de->extra = strdup(text+1);
//Serial.printf("parsing 'g' entry: extra is '%s'\n", de->extra);
}
break;
case 'r':
@ -987,7 +984,7 @@ void Display::parseDispElement(char *text, DispEntry *de)
de->extra = strdup(text+1);
break;
default:
Serial.printf("Unknown element: %c\n", type);
LOG_W(TAG, "parseDispElement: unknown: %c\n", type);
break;
}
}
@ -1032,7 +1029,6 @@ int Display::countEntries(File f) {
break;
}
f.seek(pos, SeekSet);
//Serial.printf("Counted %d entries\n", n);
return n;
}
@ -1062,13 +1058,16 @@ void Display::initFromFile(int index) {
index = getScreenIndex(index); // auto selection for index==0
snprintf(file, 20, "/screens%d.txt", index);
Serial.printf("Reading %s\n", file);
LOG_I(TAG, "init: reading file %s\n", file);
d = LittleFS.open(file, "r");
if(!d || d.available()==0 ) { Serial.printf("%s not found\n", file); return; }
if(!d || d.available()==0 ) {
LOG_E(TAG, "init: %s not found\n", file);
return;
}
DispInfo *newlayouts = (DispInfo *)malloc(MAXSCREENS * sizeof(DispInfo));
if(!newlayouts) {
Serial.println("Init from file: FAILED, not updating layouts");
LOG_E(TAG, "initFromFail: FAILED, not updating layouts\n");
return;
}
memset(newlayouts, 0, MAXSCREENS * sizeof(DispInfo));
@ -1084,15 +1083,11 @@ void Display::initFromFile(int index) {
int idx = -1;
int what = -1;
int entrysize;
Serial.printf("Reading from screen config: available=%d\n",d.available());
LOG_I(TAG, "Reading from screen config: available=%d\n", d.available());
while(d.available()) {
//Serial.printf("Unused stack: %d\n", uxTaskGetStackHighWaterMark(0));
const char *ptr;
readLine(d, lineBuf, LINEBUFLEN);
const char *s = trim(lineBuf);
// String line = readLine(d);
// line.trim();
// const char *s = line.c_str();
DebugPrintf(DEBUG_SPARSER, "Line: '%s'\n", s);
if(*s == '#') continue; // ignore comments
switch(what) {
@ -1100,7 +1095,7 @@ void Display::initFromFile(int index) {
{
if(*s != '@') {
if(*s==0 || *s==10 || *s==13) continue;
Serial.printf("Illegal start of screen: %s\n", s);
LOG_I(TAG, "initFromFile: Illegal start of screen: %s\n", s);
continue;
}
char *label = strdup(s+1);
@ -1109,7 +1104,7 @@ void Display::initFromFile(int index) {
idx++;
int res = allocDispInfo(entrysize, &newlayouts[idx], label);
if(res<0) {
Serial.println("Error allocating memory for disp info");
LOG_E(TAG, "Error allocating memory for disp info");
continue;
}
what = 0;
@ -1128,7 +1123,7 @@ void Display::initFromFile(int index) {
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]);
//LOG_I(TAG, "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;
sscanf(s+11, "%c,%c,%c,%c", &c1, &c2, &c3, &c4);
@ -1143,7 +1138,7 @@ void Display::initFromFile(int index) {
newlayouts[idx].actions[6] = ACTION(c2);
newlayouts[idx].actions[7] = ACTION(c3);
newlayouts[idx].actions[8] = ACTION(c4);
//Serial.printf("parsing key2action: %c %c %c %c\n", c1, c2, c3, c4);
//LOG_I(TAG, "parsing key2action: %c %c %c %c\n", c1, c2, c3, c4);
} else if(strncmp(s, "timeaction=",11)==0) { // timer actions
char c1,c2,c3;
sscanf(s+11, "%c,%c,%c", &c1, &c2, &c3);
@ -1228,7 +1223,7 @@ void Display::circ(uint16_t *bm, int16_t size, int16_t x0, int16_t y0, int16_t r
void Display::setLayout(int newidx) {
Serial.printf("setLayout: %d (max is %d)\n", newidx, nLayouts);
LOG_D(TAG, "setLayout: %d (max is %d)\n", newidx, nLayouts);
if(newidx>=nLayouts) newidx = 0;
layout = &layouts[newidx];
layoutIdx = newidx;
@ -1327,7 +1322,7 @@ void Display::drawRSSI(DispEntry *de) {
if(sonde.config.disptype!=1) {
snprintf(buf, 16, "-%d ", sonde.si()->rssi/2);
int len=strlen(buf)-3;
Serial.printf("drawRSSI: %d %d %d (%d)[%d]\n", de->y, de->x, sonde.si()->rssi/2, sonde.currentSonde, len);
LOG_D(TAG, "drawRSSI: %d %d %d (%d)[%d]\n", de->y, de->x, sonde.si()->rssi/2, sonde.currentSonde, len);
buf[5]=0;
drawString(de,buf);
rdis->drawTile(de->x+len, de->y, 1, (sonde.si()->rssi&1)?halfdb_tile1:empty_tile1);
@ -1634,7 +1629,7 @@ void Display::drawGPS(DispEntry *de) {
if(border<7) border=7; // space for "N" label
int size = 1 + 2*circinfo->radius + 2*border;
uint16_t *bitmap = (uint16_t *)malloc(sizeof(uint16_t) * size * size);
Serial.printf("Drawing circle with size %d at %d,%d\n",size,de->x, de->y);
LOG_D(TAG, "Drawing circle with size %d at %d,%d\n",size,de->x, de->y);
for(int i=0; i<size*size; i++) { bitmap[i] = 0; }
// draw circle
int x0=size/2;
@ -1656,7 +1651,7 @@ void Display::drawGPS(DispEntry *de) {
angA += angN; if(angA>=360) angA-=360;
angB += angN; if(angB>=360) angB-=360;
}
Serial.printf("GPS0: %c%c%c N=%d, A=%d, B=%d\n", circinfo->top, circinfo->arr, circinfo->bul, angN, angA, angB);
LOG_D(TAG, "GPS0: %c%c%c N=%d, A=%d, B=%d\n", circinfo->top, circinfo->arr, circinfo->bul, angN, angA, angB);
// "N" in direction angN
#if 1
// TODO
@ -1680,7 +1675,7 @@ void Display::drawGPS(DispEntry *de) {
yb = de->y + y0 + xf*circinfo->awidth;
xc = de->x + x0 - yf*circinfo->awidth;
yc = de->y + y0 - xf*circinfo->awidth;
Serial.printf("%d: %d,%d\n", alpha, xa, ya);
LOG_D(TAG, "%d: %d,%d\n", alpha, xa, ya);
if(validA==-1)
rdis->drawTriangle(xa,ya,xb,yb,xc,yc,circinfo->acol, false);
else if(validA==1)
@ -1704,14 +1699,15 @@ void Display::drawBatt(DispEntry *de) {
case 'V':
val = (float)(analogRead(sonde.config.batt_adc)) / 4095 * 2 * 3.3 * 1.1;
snprintf(buf, 30, "%.2f%s", val, de->extra + 1);
Serial.printf("Batt: %s", buf);
break;
default:
*buf = 0;
}
rdis->setFont(de->fmt);
drawString(de, buf);
} else {
LOG_D(TAG, "drawBatt [%c]: %s\n", de->extra[0], buf);
return;
}
*buf = 0;
xSemaphoreTake( axpSemaphore, portMAX_DELAY );
switch(de->extra[0]) {
@ -1722,12 +1718,10 @@ void Display::drawBatt(DispEntry *de) {
}
else if (pmu->isCharging()) { strcpy(buf, "C"); } // charging
else { strcpy(buf, "B"); } // battery, but not charging
Serial.printf("Battery: %s\n", buf);
break;
case 'V':
val = pmu->getBattVoltage();
snprintf(buf, 30, "%.2f%s", val/1000, de->extra+1);
Serial.printf("Vbatt: %s\n", buf);
break;
case 'U':
if(sonde.config.type == TYPE_M5_CORE2) {
@ -1743,7 +1737,10 @@ void Display::drawBatt(DispEntry *de) {
break;
}
snprintf(buf, 30, "%.2f%s", val/1000, de->extra+1);
Serial.printf("Vbus: %s\n", buf);
break;
case 'T':
val = pmu->getTemperature();
snprintf(buf, 30, "%.2f%s", val, de->extra+1);
break;
}
if(pmu->type==TYPE_AXP192) {
@ -1751,12 +1748,10 @@ void Display::drawBatt(DispEntry *de) {
case 'C':
val = pmu->getBattChargeCurrent();
snprintf(buf, 30, "%.2f%s", val, de->extra+1);
Serial.printf("Icharge: %s\n", buf);
break;
case 'D':
val = pmu->getBattDischargeCurrent();
snprintf(buf, 30, "%.2f%s", val, de->extra+1);
Serial.printf("Idischarge: %s\n", buf);
break;
case 'I':
if(sonde.config.type == TYPE_M5_CORE2) {
@ -1765,25 +1760,16 @@ void Display::drawBatt(DispEntry *de) {
val = pmu->getVbusCurrent();
}
snprintf(buf, 30, "%.2f%s", val, de->extra+1);
Serial.printf("Ibus: %s\n", buf);
break;
case 'T':
val = pmu->getTemperature();
snprintf(buf, 30, "%.2f%s", val, de->extra+1);
Serial.printf("temp: %s\n", buf);
break;
}
} else if (pmu->type == TYPE_AXP2101) {
*buf = 0;
if(de->extra[0]=='T') {
val = pmu->getTemperature();
snprintf(buf, 30, "%.2f%s", val, de->extra+1);
}
else if (pmu->type == TYPE_AXP2101) {
// AXP2101-specific items here... I guess there are none for now...
}
xSemaphoreGive( axpSemaphore );
rdis->setFont(de->fmt);
drawString(de, buf);
}
LOG_D(TAG, "drawBatt [%c]: %s\n", de->extra[0], buf);
}
void Display::drawText(DispEntry *de) {
@ -1838,7 +1824,7 @@ void Display::updateDisplayRXConfig() {
void Display::updateDisplayIP() {
for(DispEntry *di=layout->de; di->func != NULL; di++) {
if(di->func != disp.drawIP) continue;
Serial.printf("updateDisplayIP: %d %d\n",di->x, di->y);
LOG_D(TAG, "updateDisplayIP: %d %d\n",di->x, di->y);
di->func(di);
}
}
@ -1854,23 +1840,23 @@ void Display::updateDisplay() {
// Called when key is pressed or new RX starts
void Display::dispsavectlON() {
// nothing to do to turn display on, may add power on code here later
Serial.println("DISP SAVE: ON");
LOG_D(TAG, "DISP SAVE: ON");
dispstate = 1;
}
// Should be called 1x / sec to update display
// parameter: rxactive (1=currently receiving something, 0=no rx)
void Display::dispsavectlOFF(int rxactive) {
Serial.printf("DISP SAVE: OFF %d (state is %d)\n", rxactive, dispstate);
LOG_D(TAG, "DISP SAVE: OFF %d (state is %d)\n", rxactive, dispstate);
if( sonde.config.dispsaver == 0 ) return; // screensaver disabled
if( dispstate == 0 ) return; // already OFF
if( rxactive && ((sonde.config.dispsaver%10)==2) ) return; // OFF only if no RX, but rxactive is 0
dispstate++;
Serial.printf("dispstate is %d\n", dispstate);
LOG_D(TAG, "dispstate is %d\n", dispstate);
if( dispstate > (sonde.config.dispsaver/10) ) {
rdis->clear();
dispstate = 0;
Serial.println("Clearning display");
LOG_D(TAG, "Clearning display\n");
}
}

View File

@ -1,4 +1,4 @@
const char *version_name = "rdzTTGOsonde";
const char *version_id = "dev20240905";
const char *version_id = "dev20240905b";
const int SPIFFS_MAJOR=3;
const int SPIFFS_MINOR=3;