Small fixes

- no double SD card init
- removed "noHighlightCounter" warning
- wipe the screen buffers before setting up the layer (removes shadow image on boot)
This commit is contained in:
Raphael Coeffic
2021-05-09 11:02:57 +02:00
parent 6956398a50
commit cc5ae4d2a9
6 changed files with 8 additions and 16 deletions
-3
View File
@@ -31,9 +31,6 @@ extern int menuVerticalOffset;
extern uint8_t menuCalibrationState;
// Temporary no highlight
extern uint8_t noHighlightCounter;
#define NO_HIGHLIGHT() (noHighlightCounter > 0)
#define START_NO_HIGHLIGHT() do { noHighlightCounter = 25; } while(0)
typedef bool (*MenuHandlerFunc)(event_t event);
-1
View File
@@ -1085,7 +1085,6 @@ void ModelSetupPage::build(FormWindow * window)
new CheckBox(window, grid.getFieldSlot(2, 0), GET_SET_DEFAULT(g_model.extendedTrims));
new TextButton(window, grid.getFieldSlot(2, 1), STR_RESET_BTN,
[]() -> uint8_t {
START_NO_HIGHLIGHT();
for (auto &flightModeData : g_model.flightModeData) {
memclear(&flightModeData, TRIMS_ARRAY_SIZE);
}
+1 -5
View File
@@ -33,13 +33,9 @@ void drawSplash()
static BitmapBuffer * splashImg = nullptr;
if (loadImgFromSD && splashImg == nullptr) {
bool sd_mounted = sdMounted();
if (!sd_mounted)
sdInit();
if (!sdMounted()) sdInit();
splashImg = BitmapBuffer::loadBitmap(BITMAPS_PATH "/" SPLASH_FILE);
loadImgFromSD = false;
if (!sd_mounted)
sdDone();
}
lcd->clear();