2021-11-19 04:07 AM
hi
im driving ili9341 lcd with spi1 and w25q128 with spi2 with stm32f103c8t6.
im loading some images from w25q128 to lcd via dma (peripheral to peripheral).
i should check if the last image has been sent to lcd or not before putting other images . so i used :
_Bool LCD_BUSY
before sending new data to lcd i will check it .....
but i get stuck in while loop for ever . and in debugger it says that (_Bool LCD_BUSY ) is 0 !!!
but if i put HAL_DELAY(1); in while loop it will work !
not WORKING:
while(LCD_BUSY){}
working;
while(LCD_BUSY){HAL_DELAY(1);}
2021-11-19 04:47 AM
LCD_BUSY needs to be declared volatile if it is used in both an ISR and the main loop.
volatile _Bool LCD_BUSY;