From 2e91bcd137fb072f152286dc44058407e6f532fa Mon Sep 17 00:00:00 2001 From: Bodmer Date: Mon, 13 Nov 2017 21:15:28 +0000 Subject: [PATCH] Issue #53 fix In case of a non- supported BMP, the _tft->setRotation() should not be executed. --- examples/320 x 240/weather-station-v8/GfxUi.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/320 x 240/weather-station-v8/GfxUi.cpp b/examples/320 x 240/weather-station-v8/GfxUi.cpp index 4716da0..989ccd1 100644 --- a/examples/320 x 240/weather-station-v8/GfxUi.cpp +++ b/examples/320 x 240/weather-station-v8/GfxUi.cpp @@ -156,9 +156,12 @@ void GfxUi::drawBmp(String filename, uint8_t x, uint16_t y) { } // End of bitmap access } // End of bitmap file check - bmpFile.close(); - if(!goodBmp) Serial.println(F("BMP format not recognised.")); - _tft->setRotation(rotation); // Put back original rotation + if(!goodBmp) { + Serial.print(F("BMP format not recognised. File:")); + Serial.println(filename); + } + else + _tft->setRotation(rotation); // Put back original rotation } // These read 16- and 32-bit types from the SD card file.