upd ratelimit, ILI9342 (M5Stack) font fix

This commit is contained in:
Hansi, dl9rdz 2024-09-13 11:12:53 +00:00
parent 81d654dff6
commit ee957cff72
4 changed files with 22 additions and 10 deletions

View File

@ -482,6 +482,7 @@ struct gfxoffset_t gfxoffsets[MAXFONT];
void calc_gfx_offsets() {
for(int i=0; i<ngfx; i++) {
// find offset from top to baseline
int bofs = 0;
GFXglyph *g = gfl[i]->glyph;
@ -496,6 +497,9 @@ void calc_gfx_offsets() {
if(h>hgt) hgt=h;
}
gfxoffsets[i].yclear = hgt;
///// The GFX library does things differently, and if we end up with a smaller baseline then positions might be out of bounds
///// causing a lack of background on ILI9342. Make sure that we use a large enough baseline!
gfxoffsets[i].yofs = gfl[i]->yAdvance * 2 / 3;
printf("Font %d: yofs=%d, yclear=%d\n", i, gfxoffsets[i].yofs, gfxoffsets[i].yclear);
}
}

View File

@ -73,8 +73,13 @@ void ConnAPRS::updateSonde( SondeInfo *si ) {
char *str = aprs_senddata(si, sonde.config.call, sonde.config.objcall, sonde.config.tcpfeed.symbol);
Serial.printf("udpfedd active: %d tcpfeed active: %d\n", sonde.config.udpfeed.active, sonde.config.tcpfeed.active);
unsigned long now = millis();
// Output via AXUDP
if(sonde.config.udpfeed.active) {
static unsigned long lastudp = 0;
long tts = sonde.config.udpfeed.ratelimit * 1000L - (now - lastudp);
Serial.printf("aprs-udp: now-last = %ld\n", (now - lastudp));
if ( tts < 0 ) {
char raw[201];
int rawlen = aprsstr_mon2raw(str, raw, APRS_MAXLEN);
Serial.println("Sending AXUDP");
@ -82,6 +87,10 @@ void ConnAPRS::updateSonde( SondeInfo *si ) {
udp.beginPacket(udphost, udpport);
udp.write((const uint8_t *)raw, rawlen);
udp.endPacket();
lastudp = now;
} else {
Serial.printf("Sending APRS-UDP in %d s\n", (int)(tts/1000));
}
}
// KISS via TCP (incoming connection, e.g. from APRSdroid
if (tncclient.connected()) {
@ -96,7 +105,6 @@ void ConnAPRS::updateSonde( SondeInfo *si ) {
static unsigned long lasttcp = 0;
tcpclient_fsm();
if(aprs[0].tcpclient_state == TCS_CONNECTED || aprs[1].tcpclient_state == TCS_CONNECTED) {
unsigned long now = millis();
long tts = sonde.config.tcpfeed.highrate * 1000L - (now-lasttcp);
Serial.printf("aprs: now-last = %ld\n", (now - lasttcp));
if ( tts < 0 ) {

View File

@ -41,6 +41,7 @@ void ConnSDCard::init() {
uint32_t totalSize = SD.totalBytes() / (1024 * 1024);
Serial.printf("SD Card used/total: %lu/%lu MB\n", usedSize, totalSize);
#if 0
file = SD.open("/data.csv", FILE_APPEND);
if (!file) {
Serial.println("Cannot open file");
@ -51,7 +52,6 @@ void ConnSDCard::init() {
//sdf = SD.open("/data.csv", FILE_READ);
#if 0
// Just testcode
DIR *dir = opendir("/sd/");
struct dirent *dent;

View File

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