Let\'s say I have function 1 and an isr routine, both share and update the same flag without any lock between them. the system is single th
function 1
isr routine
It will be better if you can declare the flag as : volatile int flag; or volatile bool flag;
volatile int flag;
volatile bool flag;