1
0
forked from me/IronOS

Update GUIThread.cpp

This commit is contained in:
discip
2022-01-19 02:08:03 +01:00
committed by GitHub
parent 385bcfa59e
commit cb7756d381

View File

@@ -831,7 +831,8 @@ void showWarnings() {
#endif
}
uint8_t idleScreenBGF[sizeof(idleScreenBG)];
uint8_t buttonAF[sizeof(buttonA)];
uint8_t buttonBF[sizeof(buttonB)];
uint8_t disconnectedTipF[sizeof(disconnectedTip)];
/* StartGUITask function */
void startGUITask(void const *argument) {
@@ -851,12 +852,13 @@ void startGUITask(void const *argument) {
// Generate the flipped screen into ram for later use
// flipped is generated by flipping each row
for (int row = 0; row < 2; row++) {
for (int x = 0; x < 84; x++) {
idleScreenBGF[(row * 84) + x] = idleScreenBG[(row * 84) + (83 - x)];
}
for (int x = 0; x < 41; x++) {
buttonAF[(row * 41) + x] = buttonA[(row * 41) + (40 - x)];
disconnectedTipF[(row * 41) + x] = disconnectedTip[(row * 41) + (40 - x)];
}
for (int x = 0; x < 43; x++) {
buttonBF[(row * 43) + x] = buttonB[(row * 43) + (42 - x)];
}
}
}
getTipRawTemp(1); // reset filter
@@ -1033,12 +1035,13 @@ void startGUITask(void const *argument) {
#else
if (OLED::getRotation()) {
#endif
OLED::drawArea(12, 0, 84, 16, idleScreenBG);
OLED::drawArea(55, 0, 41, 16, buttonA);
OLED::drawArea(12, 0, 43, 16, buttonB);
OLED::setCursor(0, 0);
gui_drawBatteryIcon();
} else {
OLED::drawArea(0, 0, 84, 16, idleScreenBGF); // Needs to be flipped so button ends up
// on right side of screen
OLED::drawArea(0, 0, 41, 16, buttonAF); // Needs to be flipped so button ends up
OLED::drawArea(41, 0, 43, 16, buttonBF); // on right side of screen
OLED::setCursor(84, 0);
gui_drawBatteryIcon();
}