From 44e373764505bc9b6ee3cd33e0c30ba4252062b2 Mon Sep 17 00:00:00 2001 From: "Hansi, dl9rdz" Date: Tue, 1 Dec 2020 15:42:23 +0100 Subject: [PATCH] nits --- RX_FSK/RX_FSK.ino | 3 ++- RX_FSK/data/index.html | 14 +++++++--- RX_FSK/data/screens2.txt | 6 ++--- libraries/SondeLib/Display.cpp | 49 +++++++++++++++++++++++++--------- libraries/SondeLib/Sonde.cpp | 3 +++ 5 files changed, 54 insertions(+), 21 deletions(-) diff --git a/RX_FSK/RX_FSK.ino b/RX_FSK/RX_FSK.ino index f749016..4a62ccd 100644 --- a/RX_FSK/RX_FSK.ino +++ b/RX_FSK/RX_FSK.ino @@ -387,7 +387,8 @@ void addSondeStatus(char *ptr, int i) s->burstKT, s->launchKT, s->countKT, ((uint16_t)s->frame - s->crefKT)); } sprintf(ptr + strlen(ptr), "GEO-App - ", s->lat, s->lon); - sprintf(ptr + strlen(ptr), "WX.DL2MF.de - ", s->id); + sprintf(ptr + strlen(ptr), "wetterson.de - ", s->id); + sprintf(ptr + strlen(ptr), "radiosondy.info - ", s->id); sprintf(ptr + strlen(ptr), "OSM", s->lat, s->lon); strcat(ptr, "

\n"); } diff --git a/RX_FSK/data/index.html b/RX_FSK/data/index.html index 1784bbb..748c958 100644 --- a/RX_FSK/data/index.html +++ b/RX_FSK/data/index.html @@ -18,7 +18,7 @@ - + @@ -39,9 +39,11 @@ -

+

Configuration

@@ -57,8 +59,12 @@

About

%VERSION_NAME%
Copyright © 2019 by Hansi Reiser, DL9RDZ
- (version %VERSION_ID%)
- with mods by Meinhard Guenther, DL2MF
+ (version %VERSION_ID%)

+ with contributions by Meinhard Guenther, DL2MF, + Johannes, Robert Stefanowicz, + Josema, and probably some more people I forgot to mention here. + +

Autodetect info: %AUTODETECT_INFO%

diff --git a/RX_FSK/data/screens2.txt b/RX_FSK/data/screens2.txt index 8c373e7..d363393 100644 --- a/RX_FSK/data/screens2.txt +++ b/RX_FSK/data/screens2.txt @@ -349,20 +349,20 @@ color=00FF00 3,0=xMEMORY 3,9=xLAUNCH SITE color=639AFF -4,0=S/ +4,0,9=S/ 4,9=S #Row 3 color=00FF00 6,0=xTYPE 6,9=xFREQUENCY color=639AFF -7,0=T +7,0,9=T 7,9=F MHz #Row 4 fonts=0,5 color=285454 11.5,0=xIP ADDRESS: -10.9,8.8=N +10.9,22,-15=N #Footer color=FF0000 12.7,18=bVV diff --git a/libraries/SondeLib/Display.cpp b/libraries/SondeLib/Display.cpp index d6b455f..a3249a6 100644 --- a/libraries/SondeLib/Display.cpp +++ b/libraries/SondeLib/Display.cpp @@ -388,25 +388,39 @@ void ILI9225Display::getDispSize(uint8_t *height, uint8_t *width, uint8_t *lines void ILI9225Display::drawString(uint8_t x, uint8_t y, const char *s, int16_t width, uint16_t fg, uint16_t bg) { int16_t w,h; boolean alignright=false; - if(findex<3) { // standard font - DebugPrintf(DEBUG_DISPLAY, "Simple Text %s at %d,%d [%d]\n", s, x, y, width); - tft->drawText(x, y, s, fg); - return; - } - // GFX font if(width<0) { width = -width; alignright = true; } + // Standard font + if(findex<3) { + DebugPrintf(DEBUG_DISPLAY, "Simple Text %s at %d,%d [%d]\n", s, x, y, width); + tft->setBackgroundColor(bg); + int h = tft->getFont().height; + if( alignright ) { + w = tft->getTextWidth(s); + if( width==WIDTH_AUTO ) { width = w; } + if( width > w ) { + tft->fillRectangle(x - width, y, x - w, y + h - 1, bg); + } + tft->drawText(x - w, y, s, fg); + } else { + int curx = tft->drawText(x, y, s, fg); + if( width==WIDTH_AUTO ) { return; } + if(curx < x + width) { + tft->fillRectangle(curx, y, x + width - 1, y + h - 1, bg); + } + } + return; + } + // GFX font if(width==WIDTH_AUTO || alignright) { tft->getGFXTextExtent(s, x, y + gfxoffsets[findex-3].yofs, &w, &h); - if(width==WIDTH_AUTO) { - width=w; - if(alignright) { - x -= w; - DebugPrint(DEBUG_DISPLAY, "reducing x by widht, its now "); - Serial.println(x); - } + if(width==WIDTH_AUTO) { width=w; } + if(alignright) { + if(w > width) width = w; + x -= width; + DebugPrintf(DEBUG_DISPLAY, "Reducing x by width %d, its now %d\n", width, x); } } @@ -424,14 +438,22 @@ void ILI9225Display::drawString(uint8_t x, uint8_t y, const char *s, int16_t wid // Text by drawing bitmap.... => less "flicker" uint16_t height = gfxoffsets[findex-3].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); + heap_caps_print_heap_info(MALLOC_CAP_DEFAULT); + return; + } for(int i=0; idrawGFXcharBM(x0, y0, s[k], fg, bitmap, width, height) + 1; DebugPrintf(DEBUG_DISPLAY,"[%c->%d]",s[k],x0); } + // TODO: if x+width exceeds display width, garbage is generated.... drawBitmap(x, y, bitmap, width, height); free(bitmap); #endif @@ -704,6 +726,7 @@ void Display::parseDispElement(char *text, DispEntry *de) // Large font can be used arbitrarily if(de->fmt==fontsma) de->fmt=0; de->func = disp.drawIP; break; + de->extra = strdup(text+1); case 's': de->func = disp.drawSite; de->extra = strdup(text+1); diff --git a/libraries/SondeLib/Sonde.cpp b/libraries/SondeLib/Sonde.cpp index 402b112..e120d5d 100644 --- a/libraries/SondeLib/Sonde.cpp +++ b/libraries/SondeLib/Sonde.cpp @@ -445,6 +445,9 @@ void Sonde::setup() { float afcbw = sx1278.getAFCBandwidth(); float rxbw = sx1278.getRxBandwidth(); Serial.printf("AFC BW: %f RX BW: %f\n", afcbw, rxbw); + + // reset rxtimer / norxtimer state + sonde.sondeList[sonde.currentSonde].lastState = -1; } extern void flashLed(int ms);