Merge commit '6a3a9a1' into feature/turbo-menu

This commit is contained in:
Lewis Jackson 2023-05-29 23:35:32 +03:00
commit e677d9bd1e
2 changed files with 11 additions and 32 deletions

View file

@ -10,26 +10,7 @@ void WatchyDisplayBase::clearScreen(uint8_t value)
{ {
writeScreenBuffer(value); writeScreenBuffer(value);
refresh(true); refresh(true);
writeScreenBufferAgain(value);
if (!_using_partial_mode) {
InitPart();
}
_startTransfer();
TransferCommand(0x24);
for (uint32_t i = 0; i < uint32_t(WIDTH) * uint32_t(HEIGHT) / 8; i++) {
_transfer(value);
}
_endTransfer();
// Is this necessary? Come back to this - FIXME
_startTransfer();
TransferCommand(0x26);
for (uint32_t i = 0; i < uint32_t(WIDTH) * uint32_t(HEIGHT) / 8; i++) {
_transfer(value);
}
_endTransfer();
_initial_write = false; // initial full screen buffer clean done
} }
// init controller memory (default white) // init controller memory (default white)
@ -48,8 +29,6 @@ void WatchyDisplayBase::writeScreenBuffer(uint8_t value)
} }
_endTransfer(); _endTransfer();
_initial_write = false;
} }
_startTransfer(); _startTransfer();
@ -60,6 +39,8 @@ void WatchyDisplayBase::writeScreenBuffer(uint8_t value)
} }
_endTransfer(); _endTransfer();
_initial_write = false;
} }
void WatchyDisplayBase::writeScreenBufferAgain(uint8_t value) void WatchyDisplayBase::writeScreenBufferAgain(uint8_t value)
@ -86,15 +67,7 @@ void WatchyDisplayBase::writeImage(const uint8_t * bitmap, int16_t x, int16_t y,
void WatchyDisplayBase::writeImageInternal(uint8_t command, const uint8_t * bitmap, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) void WatchyDisplayBase::writeImageInternal(uint8_t command, const uint8_t * bitmap, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
{ {
if (_initial_write) { if (_initial_write) {
_startTransfer(); writeScreenBuffer();
TransferCommand(0x24);
for (uint32_t i = 0; i < uint32_t(WIDTH) * uint32_t(HEIGHT) / 8; i++) {
_transfer(0xFF);
}
_endTransfer();
_initial_write = false;
} }
#if defined(ESP8266) || defined(ESP32) #if defined(ESP8266) || defined(ESP32)
yield(); // avoid wdt yield(); // avoid wdt
@ -120,7 +93,7 @@ void WatchyDisplayBase::writeImageInternal(uint8_t command, const uint8_t * bitm
SetPartialRamArea(x1, y1, w1, h1); SetPartialRamArea(x1, y1, w1, h1);
_startTransfer(); _startTransfer();
TransferCommand(0x24); TransferCommand(command);
for (int16_t i = 0; i < h1; i++) { for (int16_t i = 0; i < h1; i++) {
for (int16_t j = 0; j < w1 / 8; j++) { for (int16_t j = 0; j < w1 / 8; j++) {
@ -156,6 +129,11 @@ void WatchyDisplayBase::writeImageForFullRefresh(const uint8_t * bitmap, int16_t
writeImageInternal(0x24, bitmap, x, y, w, h, invert, mirror_y, pgm); writeImageInternal(0x24, bitmap, x, y, w, h, invert, mirror_y, pgm);
} }
void WatchyDisplayBase::writeImageAgain(const uint8_t * bitmap, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
{
writeImageInternal(0x24, bitmap, x, y, w, h, invert, mirror_y, pgm);
}
// screen refresh from controller memory, partial screen // screen refresh from controller memory, partial screen
void WatchyDisplayBase::writeImagePart(const uint8_t * bitmap, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) void WatchyDisplayBase::writeImagePart(const uint8_t * bitmap, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
{ {

View file

@ -21,6 +21,7 @@ public:
void writeScreenBufferAgain(uint8_t value = 0xFF) override; void writeScreenBufferAgain(uint8_t value = 0xFF) override;
void writeImage(const uint8_t * bitmap, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false) override; void writeImage(const uint8_t * bitmap, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false) override;
void writeImageForFullRefresh(const uint8_t * bitmap, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false) override; void writeImageForFullRefresh(const uint8_t * bitmap, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false) override;
void writeImageAgain(const uint8_t * bitmap, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false) override;
// screen refresh from controller memory, partial screen // screen refresh from controller memory, partial screen
void writeImagePart(const uint8_t * bitmap, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false) override; void writeImagePart(const uint8_t * bitmap, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false) override;