summaryrefslogtreecommitdiff
path: root/src/Components/Gfx/Gfx.cpp
diff options
context:
space:
mode:
authorJF <jf@codingfield.com>2020-06-06 17:28:01 (GMT)
committerJF <jf@codingfield.com>2020-06-06 17:28:01 (GMT)
commit46b8bf9fc1b9a32c6d84d4b85cf43ab72c697679 (patch)
tree20c11ca02b92c474df680193e560dbabec9d524c /src/Components/Gfx/Gfx.cpp
parente7723598a65c6c041e3b4dff4d0bb144d1c697a0 (diff)
Add new target (pinetime-graphics) that flash the bootloader logo into the spi flash memory.
Diffstat (limited to 'src/Components/Gfx/Gfx.cpp')
-rw-r--r--src/Components/Gfx/Gfx.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Components/Gfx/Gfx.cpp b/src/Components/Gfx/Gfx.cpp
index ed323bc..3c5dbfb 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<const uint8_t *>(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.