Skip to content

Commit d0afacc

Browse files
aurel32nashif
authored andcommitted
display: ssd1673: replace k_busy_wait by k_sleep
The SSD1673 driver currently use k_busy_wait to wait for the controller to finish the execution of a commmand. However a display update command can take from a few hundreds of ms (default LUT) to almost a second (initial LUT). k_busy_wait is just a spinning loop, which prevents all the threads with lower priority to not be executed during that time. That could be the case for example of the shell or the log thread. As the timing is not critical, it's better to use k_sleep instead, allowing the CPU to process other threads. In the long term it might even be better to use an interrupt there, but might not be that easy if we want to support to various SoCs that can be connected to such a display. Signed-off-by: Aurelien Jarno <[email protected]>
1 parent 0a51dd8 commit d0afacc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/display/ssd1673.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ static inline void ssd1673_busy_wait(struct ssd1673_data *driver)
9494

9595
gpio_pin_read(driver->busy, DT_SOLOMON_SSD1673FB_0_BUSY_GPIOS_PIN, &val);
9696
while (val) {
97-
k_busy_wait(SSD1673_BUSY_DELAY);
97+
k_sleep(SSD1673_BUSY_DELAY);
9898
gpio_pin_read(driver->busy, DT_SOLOMON_SSD1673FB_0_BUSY_GPIOS_PIN, &val);
9999
}
100100
}

0 commit comments

Comments
 (0)