correct launchsite display on oled

pull/225/head
Hansi, dl9rdz 2021-10-10 21:39:21 +02:00
rodzic b4c0179ee6
commit e6a764b650
3 zmienionych plików z 20 dodań i 4 usunięć

Wyświetl plik

@ -115,7 +115,7 @@ timeaction=#,D,+
0,5=S#:
0,9=T
3,0=F MHz
5,0=S
5,0,16=S
7,5=n
############

Wyświetl plik

@ -305,6 +305,17 @@ void U8x8Display::getDispSize(uint8_t *height, uint8_t *width, uint8_t *lineskip
void U8x8Display::drawString(uint16_t x, uint16_t y, const char *s, int16_t width, uint16_t fg, uint16_t bg) {
char buf[50];
utf2latin15(s, buf, 50);
if(width!=WIDTH_AUTO && width>0) {
for(int l = strlen(buf); l<width; l++) {
buf[l] = ' ';
}
buf[width] = 0;
}
if(width<0) {
int l = strlen(buf);
memset(buf, ' ', width-l);
utf2latin15(s, buf+l, 50-l);
}
u8x8->drawString(x, y, buf);
}
@ -1355,8 +1366,13 @@ void Display::drawSite(DispEntry *de) {
buf[5]=0;
break;
case 0: case 'l': default: // launch site
drawString(de, sonde.si()->launchsite);
return;
// TODO: This is a workaround to be compatible with older screens1.txt
// This does not work correctly with non-ascii utf8 characters.
// For this reason, this workaround will likely be removed in the future
// Instead, all screens?.txt should always indicate the max. length of the displayed string.
snprintf(buf, 17, "%-16s", sonde.si()->launchsite);
//drawString(de, sonde.si()->launchsite);
//return;
}
if(de->extra[0]) strcat(buf, de->extra+1);
drawString(de, buf);

Wyświetl plik

@ -1,4 +1,4 @@
const char *version_name = "rdzTTGOsonde";
const char *version_id = "devel20211009";
const char *version_id = "devel20211010";
const int SPIFFS_MAJOR=2;
const int SPIFFS_MINOR=16;