Hi, I'm developing a software for C6745 whose operation, basically, is:
/*00*/ bool bWorkPending=false;
/*01*/ while(true)
/*02*/ {
/*03*/ if(bWorkPending==false)
/*04*/ {
/*05*/ asm(" IDLE");
/*06*/ }
/*07*/ else
/*08*/ {
/*09*/ doWork();
/*10*/ }
/*11*/ }
The bWorkPending variable is updated within an ISR, however, sometimes the interruption occurs between lines 3 and 5, leaving the DSP in IDLE state when there is work to be done.
Obviously the question is ... How can I make the comparison and entry into IDLE state atomically?
Thanks in advance.