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();
+4 -4
View File
@@ -126,9 +126,7 @@ void per10ms()
#if defined(GUI)
if (lightOffCounter) lightOffCounter--;
if (flashCounter) flashCounter--;
#if defined(LIBOPENUI)
#warning "TODO remove noHighlightCounter on LIBOPENUI"
#else
#if !defined(LIBOPENUI)
if (noHighlightCounter) noHighlightCounter--;
#endif
#endif
@@ -1797,7 +1795,9 @@ void opentxInit()
#if defined(SDCARD)
// SDCARD related stuff, only done if not unexpectedShutdown
if (!globalData.unexpectedShutdown) {
sdInit();
if (!sdMounted())
sdInit();
#if defined(AUTOUPDATE)
sportStopSendByteLoop();
+2 -2
View File
@@ -366,13 +366,13 @@ void lcdInit()
LTDC_Cmd(ENABLE);
/* Set Background layer */
memset(LCD_FIRST_FRAME_BUFFER, 0, sizeof(LCD_FIRST_FRAME_BUFFER));
LCD_SetLayer(LCD_FIRST_LAYER);
// lcdClear();
LCD_SetTransparency(0);
/* Set Foreground layer */
memset(LCD_SECOND_FRAME_BUFFER, 0, sizeof(LCD_SECOND_FRAME_BUFFER));
LCD_SetLayer(LCD_SECOND_LAYER);
lcd->clear();
LCD_SetTransparency(255);
}