| ??? 05/01/02 12:40 Read: times |
#22351 - RE: passing port pin (to Bert) |
Listen guys
to access a port bit in keil you do the following: sbit GreenLED = P1^0; sbit RedLED = P0^0; GreenLED = ON; RedLED = OFF; this is simple, the problem is i need to do this in a function call. Its fine you telling me function(port,bit,state) but you try it and it wont work because the SFR space is parrallel with the uper 128 bytes of ram and the only way keil can distinguish between the two is by the sfr type. the second problem is that the function cant take sfr type as arguments so it treats it as part of the upper 128 bytes of ram. The third problem is I need to make this function reentrant, and i cant pass bit types to reentrant functions. Keil doesnt allow it. can anyone help plz ? |



