Is is possible to have a routine with an sbit as a parmeter?
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.
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...?