| ??? 05/01/02 18:48 Read: times |
#22385 - RE: passing port pin to a function |
You can never make a function or non-atomic sequence of instructions reentrant if they deal with static data, such as an sbit. You cannot do this reentrantly but you can do it. First, declare the set/clr function with the reentrant keyword and bracket each function by #pragma NOAREGS ... #pragma AREGS. No you can all the functions from background or ISR's.
Just realize that if you set a port pin one way from a background call and then get an interrupt that clears it, you may not see the LED change state. This is a design problem though not an implementation issue. |



