AnsweredAssumed Answered

Optimization problem

Question asked by neuzzo on Mar 3, 2016
Latest reply on Mar 9, 2016 by MJW

I have a problem with this code when activate optimization:

inside main i have this cycle, that waiting a trigger of interrupt to proceed:

for(;;)

{

WaitTrigger();

..

...

}

 

void WaitTrigger(void)

{

  while (!appTrigger)

   ;

  appTrigger = FALSE;

}

 

and appTrigger  is forced TRUE by interrupt.

 

with -O0 working fine, but if I insert -O1 stop work.

 

I can disable the optimization in this area, or other idea to enable the optimization?

Outcomes