??? 02/21/07 15:36 Modified: 02/21/07 15:37 Read: times |
#133440 - ok is \'safe\' better? Responding to: ???'s previous message |
many such "confusion avoidance" (I do not see where the confusion is) attempts have ended up with hidden traps. BTW NOAREGS will no be sufficient, REENTRANT would be required as well unless the even more dangerous "avoiding it being called from the ISR when main is using it" is implemented.
Using two copies gives a straight flow which, to me, is far less confusing than trying to sort out what heppens when two separate "tasks" use the same routine. Just a note: when I have seen such done, usually, there are some if (called_from_interrupt) or similar statements, talk about 'confusing', such routines typically end up a total mess whene one use of "(called_from_interrupt)" is missed and the place is such that the crash only happens once a month. Stating a point in an exaggerated fashion: "if making two routines instead of one allow me to skip an if, I will make two routines" Erik |