In 2017, I used the Microchip usb framework code to make a HID keyboard. Now, when I try to compile, I see an error that is related to some #define. I can't think why it now gives errors, given it compiled last time (in 2017). It should be said that in the mean time I have done an OS re-install etc.
There are no "file not found messages" above the error, and I can fix the error by manually defining the missing items:
//These 2 lines are in "usb_hal_pic16f1.h", and are not being seen now...
//#define BDT_BASE_ADDR 0x2000
//#define BDT_BASE_ADDR_TAG @ BDT_BASE_ADDR
volatile BDT_ENTRY BDT[BDT_NUM_ENTRIES] BDT_BASE_ADDR_TAG;--> ../../../../../../microchip_solutions/framework/usb/src/usb_device.c:177:40: error: expected ';' after top level declarator
The problem is a depressingly familiar one: Somewhere, a header file #ifndef is preventing the file being included, because elsewhere the header file has already been included. From experience this can take days to track down.
Is there a nice windows based tool that can track header file inter-dependencies?
Note: There is an ideal rule that states a header file should not itself include other headers. This rule is broken - but that is true in the Microchip code, and it would take forever to re-write it. I am already conciously not using the latest USB framework as I know the project did work as it was.