From 46b8bf9fc1b9a32c6d84d4b85cf43ab72c697679 Mon Sep 17 00:00:00 2001 From: JF Date: Sat, 6 Jun 2020 19:28:01 +0200 Subject: Add new target (pinetime-graphics) that flash the bootloader logo into the spi flash memory. --- src/Components/Gfx/Gfx.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/Components/Gfx/Gfx.cpp') diff --git a/src/Components/Gfx/Gfx.cpp b/src/Components/Gfx/Gfx.cpp index ed323bc0..3c5dbfb7 100644 --- a/src/Components/Gfx/Gfx.cpp +++ b/src/Components/Gfx/Gfx.cpp @@ -43,6 +43,20 @@ void Gfx::FillRectangle(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint16_t col WaitTransfertFinished(); } +void Gfx::FillRectangle(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t* b) { + state.remainingIterations = h; + state.currentIteration = 0; + state.busy = true; + state.action = Action::FillRectangle; + state.color = 0x00; + state.taskToNotify = xTaskGetCurrentTaskHandle(); + + lcd.BeginDrawBuffer(x, y, w, h); + lcd.NextDrawBuffer(reinterpret_cast(b), width * 2); + + WaitTransfertFinished(); +} + void Gfx::DrawString(uint8_t x, uint8_t y, uint16_t color, const char *text, const FONT_INFO *p_font, bool wrap) { if (y > (height - p_font->height)) { // Not enough space to write even single char. -- cgit v1.2.3-70-g09d2