Improvements & bugfix

This commit is contained in:
Filip Znachor 2022-12-07 18:44:30 +01:00
parent 3e3d6e3d91
commit ddb585c7be

View file

@ -211,12 +211,12 @@ void displayTimeDate(int lines) {
void displayDeparture(struct departure d, int y) {
M5.Lcd.fillRect(0, y*30, 40, 30, BLACK);
uint16_t color = 0xFFFFFF;
if(d.type == 1) color = 0xFFEA; // žlutá: 0xEF53 / 0xFFEB
if(d.type == 2) color = 0x6FF0;
if(d.type == 3) color = 0xFAAD;
M5.Lcd.setTextColor(color, TFT_BLACK);
M5.Lcd.fillRect(0, y*30, 40, 30, BLACK);
M5.Lcd.drawString(d.line, 0, y*30);
M5.Lcd.setTextColor(TFT_WHITE, TFT_BLACK);
@ -225,8 +225,8 @@ void displayDeparture(struct departure d, int y) {
String departure = "<1";
if(d.departure >= 10) departure = String(d.departure/10);
M5.Lcd.fillRect(290, y*30, 30, 30, BLACK);
M5.Lcd.setTextDatum(TR_DATUM);
M5.Lcd.fillRect(290, y*30, 30, 30, BLACK);
M5.Lcd.drawString(departure, 320, y*30);
M5.Lcd.setTextDatum(TL_DATUM);
@ -254,6 +254,7 @@ void addDeparture(String s) {
for(int i=0; i<departureIndex; i++) {
if(departures[i].id == d.id) {
if(d.line != "") departures[i].line = d.line;
if(d.type != 0) departures[i].type = d.type;
if(d.last_stop != "") departures[i].last_stop = d.last_stop;
if(d.departure != 0) departures[i].departure = d.departure;
return;