* According to SDCC specification, interrupt handlers MUST be placed within the file which contains
* the void main(void) function, otherwise SDCC won't be able to recognize it. It's not a bug but a feature.
* If you know how to fix this, please let me know.
Hiya,
There's a comment in main.c that asks:
https://github.com/rikka0w0/CH55x_USB_CompositeDevice/blob/489bcf73a9872945ca642d420113aea2c8824348/main.c#L27
The SDCC specification actually states that interrupt handlers must be defined in main. The implementation of the function can exist elsewhere. See http://fivedots.coe.psu.ac.th/~cj/masd/resources/sdcc-doc/SDCCUdoc-11.html
I've also independently verified this assertion using some custom USB code on the CH554, compiled using SDCC. e.g.
and in usbd.c: