This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

while sentence



Hi members forum, I put a while sentence but I believe that don't execute properly. I put a small code:

 

...

atencion_interrupt=1;

 

 

while  (atencion_interrupt!=2){ }

...

The atencion_interrupt variable change with a interrupt timer call:

 

 

 

interrupt

void cpu_timer0_isr(void){

 

 

switch (atencion_interrupt)

 {

 

 

     case 1:{ atencion_interrupt=2;

 

 

     break;

  }

//fin case 1

 

 

     case 2:{atencion_interrupt=3;

     }

//fin case 2

 

 

break;

}

//fin switch

PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;

}//fin cpu_timer0

 

 

I debug the program and entry in the cpu_timer0, this change the atencion_interrupt to 2, but when return to main program continues in while loop.

I can't understand this behaviour.

Any answer is well accept. Thanks.

guillermo