Quantcast
Channel: Processors forum - Recent Threads
Viewing all articles
Browse latest Browse all 17527

Atomic conditional before entering IDLE

$
0
0

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.


Viewing all articles
Browse latest Browse all 17527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>