critical question
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2015-04-20 12:21 AM
Posted on April 20, 2015 at 09:21
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?
This discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2015-04-24 12:30 PM
Posted on April 24, 2015 at 21:30
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''?