mightymos / ReedTripRadio

Alternative firmware for wireless 433MHz door/window reed sensors triggered by magnetic contacts.
BSD 2-Clause "Simplified" License
155 stars 7 forks source link

SDCC v4.3.0 requires parentheses for interrupt level numbers #12

Closed jordan875 closed 1 year ago

jordan875 commented 1 year ago

I am having trouble compiling. I have the following error when I run the make command:

main.c:272: warning 283: function declarator with no prototype
main.c:259: warning 85: in function send_radio_packet unreferenced local variable : 'byteToSend'
main.c:425: syntax error: token -> '0' ; column 38
make: *** [build/main.rel] Error 1

I am using macOS.

Is there any known solution for this?

Thank you

mightymos commented 1 year ago

SDCC is apparently now requiring parentheses around interrupt level numbers. In 4.2.3, support for non-parenthesized arguments to using and interrupt was dropped.

Can you add parentheses and see if the build finishes?

You can see examples in sec. 3.7 overlaying or sec. 3.8.1 among other examples in the manual: https://sdcc.sourceforge.net/doc/sdccman.pdf

jordan875 commented 1 year ago

Thank you for this. I added parentheses to interrupts 0, 2, 11 and the build now seems to have completed without errors, but with some warnings remaining.

I now have the following output, with some warnings (I have omitted the delay1us warnings):

main.c:263: warning 283: function declarator with no prototype
main.c:272: warning 283: function declarator with no prototype
main.c:259: warning 85: in function send_radio_packet unreferenced local variable : 'byteToSend'
sdcc -mmcs51 --model-small --iram-size 113 --xram-size 0 --stack-size 16 --code-size 1017 -o build/ReedTripRadio.hex build/delay.rel build/main.rel

I have the following in the build directory:

ls /Users/j/uni-STC/demos/ReedTripRadio/build
ReedTripRadio.hex   delay.lst       main.asm
ReedTripRadio.lk    delay.rel       main.lst
ReedTripRadio.map   delay.rst       main.rel
ReedTripRadio.mem   delay.sym       main.rst
delay.asm       dependencies.mk     main.sym

Very new to this so I have no idea if I am now on the right track or not.

Thanks again

mightymos commented 1 year ago

Ok great. You should now be able to do "make upload" or flash with the manual command given in the readme. Of course you also need your usb to serial hardware hooked up, with power disconnected. After you run upload/flash command it will wait for power to be applied, and you'll connect 3.3V at that time. It may take a few tries to successfully flash.

jordan875 commented 1 year ago

Much appreciated. That worked!

Thank you

mightymos commented 1 year ago

Fixed here: https://github.com/mightymos/ReedTripRadio/releases/tag/v0.3.7