mirror of
https://github.com/espressif/esp-idf.git
synced 2026-09-22 13:01:16 +03:00
fix(esp_lcd): yield from SPI ISR when color trans done callback wakes a task
The return value of on_color_trans_done ("whether a high priority task
has been waken up by this function", see esp_lcd_types.h) was discarded
by the SPI backend. A task unblocked from inside the callback (e.g. via
xSemaphoreGiveFromISR) therefore did not get scheduled until the next
FreeRTOS tick, adding up to 10 ms of latency per color transfer with the
default CONFIG_FREERTOS_HZ=100. The i80 backend already honors the
contract (need_yield -> portYIELD_FROM_ISR); do the same here.
This commit is contained in:
@@ -430,7 +430,9 @@ static void lcd_spi_post_trans_color_cb(spi_transaction_t *trans)
|
||||
|
||||
if (lcd_trans->flags.en_trans_done_cb) {
|
||||
if (spi_panel_io->on_color_trans_done) {
|
||||
spi_panel_io->on_color_trans_done(&spi_panel_io->base, NULL, spi_panel_io->user_ctx);
|
||||
if (spi_panel_io->on_color_trans_done(&spi_panel_io->base, NULL, spi_panel_io->user_ctx)) {
|
||||
portYIELD_FROM_ISR();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user