In case of a non- supported BMP, the _tft->setRotation() should not be executed.
This commit is contained in:
Bodmer
2017-11-13 21:15:28 +00:00
committed by GitHub
parent 2333e1ab5c
commit 2e91bcd137

View File

@@ -156,9 +156,12 @@ void GfxUi::drawBmp(String filename, uint8_t x, uint16_t y) {
} // End of bitmap access } // End of bitmap access
} // End of bitmap file check } // End of bitmap file check
bmpFile.close(); if(!goodBmp) {
if(!goodBmp) Serial.println(F("BMP format not recognised.")); Serial.print(F("BMP format not recognised. File:"));
_tft->setRotation(rotation); // Put back original rotation Serial.println(filename);
}
else
_tft->setRotation(rotation); // Put back original rotation
} }
// These read 16- and 32-bit types from the SD card file. // These read 16- and 32-bit types from the SD card file.