Hello,
I'm just a newbie at Maple IDE. Normally, I can use functions: cli(); y=x; sti(); in Arduino IDE. Is there something like "atomic read" for accessing a volatile variable in Maple IDE? My situation is like the code below. Please, is there also some "atomic write" func.?
[code]
volatile uint32 my_timeflag;
uint32 currentValue;
void isr_TIM2OVF(void){
my_timeflag++;
}
setup(){
// init TIM2 code
// ...
// reset counter
my_timeflag=0;
}
loop(){
//
// A PROBLEM HERE.
// I'd like to do "atomic read" of the
// "my_timeflag" var.
//
currentValue = my_timeflag; //???
// do something in loop
}
[/code]