cancel
Showing results for 
Search instead for 
Did you mean: 

while(state) get stuck for ever !!!

Preis.1
Associate

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);}

1 REPLY 1
TDK
Guru

LCD_BUSY needs to be declared volatile if it is used in both an ISR and the main loop.

volatile _Bool LCD_BUSY;

If you feel a post has answered your question, please click "Accept as Solution".