summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2024-06-28 15:34:11 +1000
committerjacqueline <me@jacqueline.id.au>2024-06-28 15:34:11 +1000
commit984b874d7e53980f96fb1581f32d771f78cb91ab (patch)
treeec6c171d303a2ccb16cb15ead2249073d56954f3 /src/drivers
parent9204b585aedd35f85d3c9118299459d3586cf499 (diff)
downloadtangara-fw-984b874d7e53980f96fb1581f32d771f78cb91ab.tar.gz
Fix some issues with the splash screen
- fix a use-after-free involving the alerts container that was happening when showing the first screen - fix some issues where the splash screen wouldn't come up as early as it needs to when another bootup task was making heavy use of the spi bus
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/display.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/drivers/display.cpp b/src/drivers/display.cpp
index 2ae70d61..efc9df93 100644
--- a/src/drivers/display.cpp
+++ b/src/drivers/display.cpp
@@ -213,6 +213,12 @@ auto Display::SetDutyCycle(uint_fast8_t new_duty, bool fade) -> void {
}
void Display::SendInitialisationSequence(const uint8_t* data) {
+ // Hold the SPI bus for the entire init sequence, as otherwise SD init may
+ // grab it and delay showing the boot splash. The total time until boot is
+ // finished may be increased by doing this, but a short boot with no feedback
+ // feels worse than a longer boot that doesn't tell you anything.
+ spi_device_acquire_bus(handle_, portMAX_DELAY);
+
// First byte of the data is the number of commands.
for (int i = *(data++); i > 0; i--) {
uint8_t command = *(data++);
@@ -232,6 +238,8 @@ void Display::SendInitialisationSequence(const uint8_t* data) {
vTaskDelay(pdMS_TO_TICKS(sleep_duration_ms));
}
}
+
+ spi_device_release_bus(handle_);
}
void Display::SendCommandWithData(uint8_t command,