2015-04-20 12:21 AM
hello, I define the critical like this:
********************************************* #define define_critical() uint8 cpu_sr #define enter_critical() cpu_sr=EnterCritical() #define exit_critical() ExitCritical(cpu_sr) uint8 EnterCritical(void) { #asm push cc sim pop a #endasm } void ExitCritical(uint8 sr) { #asm push a pop cc #endasm } ******************************* I use the critical like this: Templet fun(Templet) { define_critical(); enter_critical(); // do something exit_critical(); } But I think that, there are some hidden problems! so, what it will happen?2015-04-24 12:30 PM
Not sure what is intended with the push and pop instructions but I am pretty sure they are not doing what you intend.
Why do you need more than SIM in the ''enter'' and RIM in the ''exit''?