diff options
| author | jacqueline <me@jacqueline.id.au> | 2024-06-03 21:02:24 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2024-06-03 21:02:24 +1000 |
| commit | 39460931d8e3d044f00f7a4f58b44b1035338f09 (patch) | |
| tree | a12b989d1f132ae3c5f830959b35315d6f69c51a /src/drivers/display.cpp | |
| parent | 9457f9021a633ab97b8259f162124857cc0acf8e (diff) | |
| download | tangara-fw-39460931d8e3d044f00f7a4f58b44b1035338f09.tar.gz | |
Remove spi locking hack + increase max sd frequency
These two changes (mostly the former) dramatically increase
responsiveness when doing database updates; previously we were suffering
from some nasty priority inversion.
afaict the underlying need to acquire_spi seems to be fixed? i.e. spi
bus acquisition is working properly. fingers heavily heavily crossed.
Diffstat (limited to 'src/drivers/display.cpp')
| -rw-r--r-- | src/drivers/display.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/drivers/display.cpp b/src/drivers/display.cpp index b0a97b30..e28b6b47 100644 --- a/src/drivers/display.cpp +++ b/src/drivers/display.cpp @@ -296,6 +296,8 @@ void Display::SendTransaction(TransactionType type, void Display::OnLvglFlush(lv_disp_drv_t* disp_drv, const lv_area_t* area, lv_color_t* color_map) { + spi_device_acquire_bus(handle_, portMAX_DELAY); + // First we need to specify the rectangle of the display we're writing into. uint16_t data[2] = {0, 0}; @@ -314,6 +316,8 @@ void Display::OnLvglFlush(lv_disp_drv_t* disp_drv, SendCommandWithData(displays::ST77XX_RAMWR, reinterpret_cast<uint8_t*>(color_map), size * 2); + spi_device_release_bus(handle_); + if (!first_flush_finished_ && lv_disp_flush_is_last(disp_drv)) { first_flush_finished_ = true; SetDisplayOn(display_on_); |
