1
0
Fork 0

fix display driver issues in recovery

This commit is contained in:
petter 2021-03-20 19:34:41 +01:00
parent a3ff2e46ca
commit 3b51b4367d
2 changed files with 4 additions and 8 deletions

View file

@ -83,8 +83,7 @@ void DisplayApp::DisplayLogo(uint16_t color) {
for(int i = 0; i < displayWidth; i++) { for(int i = 0; i < displayWidth; i++) {
rleDecoder.DecodeNext(displayBuffer, displayWidth * bytesPerPixel); rleDecoder.DecodeNext(displayBuffer, displayWidth * bytesPerPixel);
ulTaskNotifyTake(pdTRUE, 500); ulTaskNotifyTake(pdTRUE, 500);
lcd.BeginDrawBuffer(0, i, displayWidth, 1); lcd.DrawBuffer(0, i, displayWidth, 1, reinterpret_cast<const uint8_t *>(displayBuffer), displayWidth * bytesPerPixel);
lcd.NextDrawBuffer(reinterpret_cast<const uint8_t *>(displayBuffer), displayWidth * bytesPerPixel);
} }
} }
@ -94,8 +93,7 @@ void DisplayApp::DisplayOtaProgress(uint8_t percent, uint16_t color) {
for(int i = 0; i < barHeight; i++) { for(int i = 0; i < barHeight; i++) {
ulTaskNotifyTake(pdTRUE, 500); ulTaskNotifyTake(pdTRUE, 500);
uint16_t barWidth = std::min(static_cast<float>(percent) * 2.4f, static_cast<float>(displayWidth)); uint16_t barWidth = std::min(static_cast<float>(percent) * 2.4f, static_cast<float>(displayWidth));
lcd.BeginDrawBuffer(0, displayWidth - barHeight + i, barWidth, 1); lcd.DrawBuffer(0, displayWidth - barHeight + i, barWidth, 1, reinterpret_cast<const uint8_t *>(displayBuffer), barWidth * bytesPerPixel);
lcd.NextDrawBuffer(reinterpret_cast<const uint8_t *>(displayBuffer), barWidth * bytesPerPixel);
} }
} }

View file

@ -134,8 +134,7 @@ void DisplayLogo() {
for(int i = 0; i < displayWidth; i++) { for(int i = 0; i < displayWidth; i++) {
rleDecoder.DecodeNext(displayBuffer, displayWidth * bytesPerPixel); rleDecoder.DecodeNext(displayBuffer, displayWidth * bytesPerPixel);
ulTaskNotifyTake(pdTRUE, 500); ulTaskNotifyTake(pdTRUE, 500);
lcd.BeginDrawBuffer(0, i, displayWidth, 1); lcd.DrawBuffer(0, i, displayWidth, 1, reinterpret_cast<const uint8_t *>(displayBuffer), displayWidth * bytesPerPixel);
lcd.NextDrawBuffer(reinterpret_cast<const uint8_t *>(displayBuffer), displayWidth * bytesPerPixel);
} }
} }
@ -145,8 +144,7 @@ void DisplayProgressBar(uint8_t percent, uint16_t color) {
for(int i = 0; i < barHeight; i++) { for(int i = 0; i < barHeight; i++) {
ulTaskNotifyTake(pdTRUE, 500); ulTaskNotifyTake(pdTRUE, 500);
uint16_t barWidth = std::min(static_cast<float>(percent) * 2.4f, static_cast<float>(displayWidth)); uint16_t barWidth = std::min(static_cast<float>(percent) * 2.4f, static_cast<float>(displayWidth));
lcd.BeginDrawBuffer(0, displayWidth - barHeight + i, barWidth, 1); lcd.DrawBuffer(0, displayWidth - barHeight + i, barWidth, 1, reinterpret_cast<const uint8_t *>(displayBuffer), barWidth * bytesPerPixel);
lcd.NextDrawBuffer(reinterpret_cast<const uint8_t *>(displayBuffer), barWidth * bytesPerPixel);
} }
} }