diff options
| author | JF <jf@codingfield.com> | 2021-03-21 17:15:07 (GMT) |
|---|---|---|
| committer | Gitea <gitea@fake.local> | 2021-03-21 17:15:07 (GMT) |
| commit | 24d3eea4fba05d774ace794eb8c9b21b8f2aa8c6 (patch) | |
| tree | 500b57847eb84f73fa62e7500e5a24d1a6d2f4cb /src/drivers/St7789.cpp | |
| parent | 5cd4b36d6bbf22095e0ff54aa3773febc6e1f22e (diff) | |
| parent | 9f9d0eb5df8ff86b9cd1e095afa3159094dde53c (diff) | |
Merge branch 'develop' of JF/PineTime into master
Diffstat (limited to 'src/drivers/St7789.cpp')
| -rw-r--r-- | src/drivers/St7789.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/drivers/St7789.cpp b/src/drivers/St7789.cpp index 2df2c53..87cbb63 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); } |
