??? 03/03/08 16:33 Read: times |
#151821 - atomicity and IE Responding to: ???'s previous message |
1) there is no need to fiddle with IE, just the bit for the device that shares the variable.
2) in critical apps the following IS possible dsbl int nop blah = shared int #1 enbl int dsbl int nop bloh = shared int #2 enbl int .... been there done that I did, when doing the above 2) try many methods, but this one is 'clean' and works (the interrupt is only disabled for a very short time. I checked the generated assembler for "improvements of the C" and did switch to U16 get_atomic1(void) push IE actual IE bit = 0 mov r6 intvar1 mov r7 intvar1+1 pop IE ret even with the function call it was faster I then expanded to an array so 2) above became one function call to an asm routine. Erik |
Topic | Author | Date |
Reposted: Critical section implementation on 8051? | 01/01/70 00:00 | |
JBC as mutex | 01/01/70 00:00 | |
why ugly? | 01/01/70 00:00 | |
atomicity and IE | 01/01/70 00:00 | |
Because ... | 01/01/70 00:00 | |
"short interrupts" is just another paradigm... | 01/01/70 00:00 |