I'm using nrf52 microcontroller (CORTEX 34F) processor. I have a variable check on the main loop which is modified both on the main loop and timer interrupt routine.
main loop check if variable is true :
execute condition code
set variable to false
- timer interrupt routine set variable to true every 10 ms
without volatile
keyword, the code seems not working, but when I set the variable to volatile
it seems to work but I'm not convinced because :
- first I think cortex M4f doesn't contain data cache memory
- second : this case is handeld by the compiler (arm keil)
any answer please ;
if true execute body code 2. List item