Is is possible to have a routine with an sbit as a parmeter?
If I remember correctly the answer is no.
There are ways to achive this. You could pass the register address and the bit number as parameters. Or you could use self-modifying code to generate instructions for sbit access.
Or you could use self-modifying code to generate instructions for sbit access.
Actually, since the '51 doesn't have indirect access to SFRs, any such routine would have to either use self-modifying code, or contain a switch() construct with a case each for every single sbit you want to access. In the latter case, you might as well set up an enum type for the argument, listing them all.
But the better answer would be: "Don't do that!"
Are you sure that nested interrupts are enabled?
The main task for an RTOS is to switch to a new thread after an interrupt signals an event.
Second time in 24 hours I managed to get my answer in the wrong thread. Strange.
Yes, but keep in mind a sbit is a bit within some special function register or bdata and its type is always bit. So the only value it can contain when passed is either a '0' or '1'.
... but can that parameter be a pointer to an sbit?
In other words pass in the sbit (possibly on an sfr) which needs to be set/cleared within the function?
Marc
My understanding is no you cannot have a pointer to a bit object only to a bit word.
I am confused on what you are trying to accomplish as an SFR has global scope. Perhaps you could provide a code snippet of what you like to accomplish and others could provide some suggestions on how they would achieve it.
http://www.keil.com/support/man/docs/c166/c166_le_bitaddrobj.htm
This is true, but this thread is about C166 - not C51.
I don't know the C166 at all - does it have indirect access to SFRs and/or bits within SFRs...?