ili9341 update

This commit is contained in:
gemu2015 2021-02-13 07:43:59 +01:00
parent 42c5af1b70
commit 3f4fda44a4
2 changed files with 23 additions and 26 deletions

View File

@ -1043,7 +1043,6 @@ void Every250mSeconds(void)
if (ota_retry_counter) {
char ota_url[TOPSZ];
strlcpy(TasmotaGlobal.mqtt_data, GetOtaUrl(ota_url, sizeof(ota_url)), sizeof(TasmotaGlobal.mqtt_data));
#ifdef ESP8266
#ifndef FIRMWARE_MINIMAL
if (RtcSettings.ota_loader) {
// OTA File too large so try OTA minimal version
@ -1078,14 +1077,6 @@ void Every250mSeconds(void)
snprintf_P(TasmotaGlobal.mqtt_data, sizeof(TasmotaGlobal.mqtt_data), PSTR("%s-" D_JSON_MINIMAL "%s"), TasmotaGlobal.mqtt_data, ota_url_type); // Minimal filename must be filename-minimal
}
#endif // FIRMWARE_MINIMAL
if (ota_retry_counter < OTA_ATTEMPTS / 2) {
if (!strcasecmp_P(TasmotaGlobal.mqtt_data, PSTR(".gz"))) {
ota_retry_counter = 1;
} else {
strcat_P(TasmotaGlobal.mqtt_data, PSTR(".gz"));
}
}
#endif // ESP8266
AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_UPLOAD "%s"), TasmotaGlobal.mqtt_data);
WiFiClient OTAclient;
ota_result = (HTTP_UPDATE_FAILED != ESPhttpUpdate.update(OTAclient, TasmotaGlobal.mqtt_data));
@ -1093,11 +1084,9 @@ void Every250mSeconds(void)
#ifndef FIRMWARE_MINIMAL
int ota_error = ESPhttpUpdate.getLastError();
DEBUG_CORE_LOG(PSTR("OTA: Error %d"), ota_error);
#ifdef ESP8266
if ((HTTP_UE_TOO_LESS_SPACE == ota_error) || (HTTP_UE_BIN_FOR_WRONG_FLASH == ota_error)) {
RtcSettings.ota_loader = 1; // Try minimal image next
}
#endif // ESP8266
#endif // FIRMWARE_MINIMAL
TasmotaGlobal.ota_state_flag = 2; // Upgrade failed - retry
}
@ -1655,7 +1644,8 @@ void GpioInit(void)
bool valid_cs = (ValidSpiPinUsed(GPIO_SPI_CS) ||
ValidSpiPinUsed(GPIO_RC522_CS) ||
(ValidSpiPinUsed(GPIO_NRF24_CS) && ValidSpiPinUsed(GPIO_NRF24_DC)) ||
(ValidSpiPinUsed(GPIO_ILI9341_CS) && ValidSpiPinUsed(GPIO_ILI9341_DC)) ||
ValidSpiPinUsed(GPIO_ILI9341_CS) ||
ValidSpiPinUsed(GPIO_ILI9341_DC) || // there are also boards without cs
ValidSpiPinUsed(GPIO_EPAPER29_CS) ||
ValidSpiPinUsed(GPIO_EPAPER42_CS) ||
ValidSpiPinUsed(GPIO_ILI9488_CS) ||

View File

@ -658,9 +658,16 @@ void DisplayText(void)
break;
case 'f':
// font sx
if (renderer) renderer->setTextFont(*cp&7);
else DisplaySetFont(*cp&7);
{ uint8_t font = *cp&7;
if (renderer) renderer->setTextFont(font);
else DisplaySetFont(font);
if (font) {
// for backward compatibility set size to 1 on non GFX fonts
if (renderer) renderer->setTextSize(1);
else DisplaySetSize(1);
}
cp += 1;
}
break;
case 'a':
// rotation angle