1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-18 13:38:12 +00:00

fix(core): replace systick based wait in display SPI with loop as systick does not work in fault handlers

[no changelog]
This commit is contained in:
tychovrahe 2023-07-14 10:00:51 +02:00 committed by TychoVrahe
parent 0a4b7eb06f
commit ad1f2360bd

View File

@ -127,7 +127,10 @@ int display_backlight(int val) {
SPI_HandleTypeDef spi_handle;
static inline void spi_send(const uint8_t *data, int len) {
HAL_Delay(1);
volatile int32_t timeout = 1000;
for (int i = 0; i < timeout; i++)
;
if (HAL_OK != HAL_SPI_Transmit(&spi_handle, (uint8_t *)data, len, 1000)) {
// TODO: error
return;