no startup screen while rebooting to OTA

This commit is contained in:
Verkehrsrot 2019-09-30 19:45:31 +02:00
parent 449d681c7b
commit e38a91162b
2 changed files with 6 additions and 6 deletions

View File

@ -200,7 +200,7 @@ void setup() {
#ifdef HAS_DISPLAY #ifdef HAS_DISPLAY
strcat_P(features, " OLED"); strcat_P(features, " OLED");
DisplayIsOn = cfg.screenon; DisplayIsOn = cfg.screenon;
init_display(); // note: blocking call init_display(!cfg.runmode); // note: blocking call
#endif #endif
#ifdef BOARD_HAS_PSRAM #ifdef BOARD_HAS_PSRAM

View File

@ -48,15 +48,13 @@ void start_ota_update() {
switch_LED(LED_ON); switch_LED(LED_ON);
#ifdef HAS_DISPLAY
// init display // init display
#ifdef HAS_DISPLAY
#ifndef DISPLAY_FLIP #ifndef DISPLAY_FLIP
oledInit(OLED_128x64, ANGLE_0, false, -1, -1, 400000L); oledInit(OLED_128x64, ANGLE_0, false, -1, -1, 400000L);
#else #else
oledInit(OLED_128x64, ANGLE_FLIPY, false, -1, -1, 400000L); oledInit(OLED_128x64, ANGLE_FLIPY, false, -1, -1, 400000L);
#endif #endif
oledFill(0, 1); oledFill(0, 1);
dp_printf(0, 0, 0, 1, "SOFTWARE UPDATE"); dp_printf(0, 0, 0, 1, "SOFTWARE UPDATE");
dp_printf(0, 1, 0, 0, "WiFi connect .."); dp_printf(0, 1, 0, 0, "WiFi connect ..");
@ -64,6 +62,7 @@ void start_ota_update() {
dp_printf(0, 3, 0, 0, "Fetching .."); dp_printf(0, 3, 0, 0, "Fetching ..");
dp_printf(0, 4, 0, 0, "Downloading .."); dp_printf(0, 4, 0, 0, "Downloading ..");
dp_printf(0, 5, 0, 0, "Rebooting .."); dp_printf(0, 5, 0, 0, "Rebooting ..");
oledDumpBuffer(NULL);
#endif #endif
ESP_LOGI(TAG, "Starting Wifi OTA update"); ESP_LOGI(TAG, "Starting Wifi OTA update");
@ -157,7 +156,7 @@ int do_ota_update() {
client.setCACert(bintray.getCertificate(currentHost)); client.setCACert(bintray.getCertificate(currentHost));
client.setTimeout(RESPONSE_TIMEOUT_MS); client.setTimeout(RESPONSE_TIMEOUT_MS);
if (!client.connect(currentHost.c_str(), port, RESPONSE_TIMEOUT_MS)) { if (!client.connect(currentHost.c_str(), port)) {
ESP_LOGI(TAG, "Cannot connect to %s", currentHost.c_str()); ESP_LOGI(TAG, "Cannot connect to %s", currentHost.c_str());
ota_display(3, " E", "connection lost"); ota_display(3, " E", "connection lost");
goto abort; goto abort;
@ -167,7 +166,7 @@ int do_ota_update() {
if (currentHost != prevHost) { if (currentHost != prevHost) {
client.stop(); client.stop();
client.setCACert(bintray.getCertificate(currentHost)); client.setCACert(bintray.getCertificate(currentHost));
if (!client.connect(currentHost.c_str(), port, RESPONSE_TIMEOUT_MS)) { if (!client.connect(currentHost.c_str(), port)) {
ESP_LOGI(TAG, "Redirect detected, but cannot connect to %s", ESP_LOGI(TAG, "Redirect detected, but cannot connect to %s",
currentHost.c_str()); currentHost.c_str());
ota_display(3, " E", "server error"); ota_display(3, " E", "server error");
@ -316,6 +315,7 @@ void ota_display(const uint8_t row, const std::string status,
dp_printf(0, 7, 0, 0, " "); dp_printf(0, 7, 0, 0, " ");
dp_printf(0, 7, 0, 0, msg.substr(0, 16).c_str()); dp_printf(0, 7, 0, 0, msg.substr(0, 16).c_str());
} }
oledDumpBuffer(NULL);
#endif #endif
} }