Ralph Doncaster schreef op 2021-02-18 16:33:
If I have an sbit defined as follows:
__sbit __at (0x90) LED;
How can I get the address? When I try &LED, I get an error:
error 35: '&' illegal operand, address of bit variable
I need the address for a function that will configure the GPIO to
push-pull
mode. I can hack it with some inline assembler:
__asm
mov dpl, #_LED
lcall _pushPull
__endasm;
Is there a way to do it in C?
On which MCU are you trying to do this? And what will pushPull do with
that address?
On most mcs51 derivatives all SFRs are in direct space only and cannot
be accessed indirectly.
Maarten
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user