diff options
Diffstat (limited to 'src/drivers')
-rw-r--r-- | src/drivers/St7789.cpp | 11 | ||||
-rw-r--r-- | src/drivers/St7789.h | 4 |
2 files changed, 3 insertions, 12 deletions
diff --git a/src/drivers/St7789.cpp b/src/drivers/St7789.cpp index 2df2c531..87cbb639 100644 --- a/src/drivers/St7789.cpp +++ b/src/drivers/St7789.cpp @@ -153,16 +153,9 @@ void St7789::DrawPixel(uint16_t x, uint16_t y, uint32_t color) { WriteSpi(reinterpret_cast<const uint8_t *>(&color), 2); } -void St7789::BeginDrawBuffer(uint16_t x, uint16_t y, uint16_t width, uint16_t height) { - if((x >= Width) || (y >= Height)) return; - if((x + width - 1) >= Width) width = Width - x; - if((y + height - 1) >= Height) height = Height - y; - - SetAddrWindow(0+x, ST7789_ROW_OFFSET+y, x+width-1, y+height-1); +void St7789::DrawBuffer(uint16_t x, uint16_t y, uint16_t width, uint16_t height, const uint8_t *data, size_t size) { + SetAddrWindow(x, y, x + width - 1, y + height - 1); nrf_gpio_pin_set(pinDataCommand); -} - -void St7789::NextDrawBuffer(const uint8_t *data, size_t size) { WriteSpi(data, size); } diff --git a/src/drivers/St7789.h b/src/drivers/St7789.h index a487a952..2c6f9b6b 100644 --- a/src/drivers/St7789.h +++ b/src/drivers/St7789.h @@ -20,9 +20,7 @@ namespace Pinetime { void VerticalScrollDefinition(uint16_t topFixedLines, uint16_t scrollLines, uint16_t bottomFixedLines); void VerticalScrollStartAddress(uint16_t line); - - void BeginDrawBuffer(uint16_t x, uint16_t y, uint16_t width, uint16_t height); - void NextDrawBuffer(const uint8_t* data, size_t size); + void DrawBuffer(uint16_t x, uint16_t y, uint16_t width, uint16_t height, const uint8_t *data, size_t size); void DisplayOn(); void DisplayOff(); |