Open nerdralph opened 3 years ago
I changed the blink example to use an function for changing the pin mode, so it will work with any GPIO pin on P1 or P3. https://github.com/nerdralph/ch554_sdcc/blob/master/examples/blink/main.c
The LED GPIO is defined by its SFR bit address. I wanted to use the address of the port bit, but SDCC doesn't permit the address operator on __sbit i.e. pushPull(&P1_4);. If you like this solution, I'll submit a pull request.
pushPull(&P1_4);
I changed the blink example to use an function for changing the pin mode, so it will work with any GPIO pin on P1 or P3. https://github.com/nerdralph/ch554_sdcc/blob/master/examples/blink/main.c
The LED GPIO is defined by its SFR bit address. I wanted to use the address of the port bit, but SDCC doesn't permit the address operator on __sbit i.e.
pushPull(&P1_4);
. If you like this solution, I'll submit a pull request.