kopia lustrzana https://github.com/dl9rdz/rdz_ttgo_sonde
correct launchsite display on oled
rodzic
b4c0179ee6
commit
e6a764b650
|
@ -115,7 +115,7 @@ timeaction=#,D,+
|
||||||
0,5=S#:
|
0,5=S#:
|
||||||
0,9=T
|
0,9=T
|
||||||
3,0=F MHz
|
3,0=F MHz
|
||||||
5,0=S
|
5,0,16=S
|
||||||
7,5=n
|
7,5=n
|
||||||
|
|
||||||
############
|
############
|
||||||
|
|
|
@ -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) {
|
void U8x8Display::drawString(uint16_t x, uint16_t y, const char *s, int16_t width, uint16_t fg, uint16_t bg) {
|
||||||
char buf[50];
|
char buf[50];
|
||||||
utf2latin15(s, 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);
|
u8x8->drawString(x, y, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1355,8 +1366,13 @@ void Display::drawSite(DispEntry *de) {
|
||||||
buf[5]=0;
|
buf[5]=0;
|
||||||
break;
|
break;
|
||||||
case 0: case 'l': default: // launch site
|
case 0: case 'l': default: // launch site
|
||||||
drawString(de, sonde.si()->launchsite);
|
// TODO: This is a workaround to be compatible with older screens1.txt
|
||||||
return;
|
// 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);
|
if(de->extra[0]) strcat(buf, de->extra+1);
|
||||||
drawString(de, buf);
|
drawString(de, buf);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const char *version_name = "rdzTTGOsonde";
|
const char *version_name = "rdzTTGOsonde";
|
||||||
const char *version_id = "devel20211009";
|
const char *version_id = "devel20211010";
|
||||||
const int SPIFFS_MAJOR=2;
|
const int SPIFFS_MAJOR=2;
|
||||||
const int SPIFFS_MINOR=16;
|
const int SPIFFS_MINOR=16;
|
||||||
|
|
Ładowanie…
Reference in New Issue