Closed
Description
The definitions of NUM_DIGITAL_PINS and NUM_ANALOG_INPUTS below:
#define NUM_DIGITAL_PINS ((uint32_t)DEND)
#define NUM_ANALOG_INPUTS ((uint32_t)(AEND-A0))
breaks code that use cpp conditionals like this:
#if NUM_ANALOG_INPUTS > 4
I've not run into this issue in any other core.
The cpp processor is not type aware and so the uint32_t cast is what breaks things.
When the cast is removed, the cpp conditionals that use the macros will work.
I'm not sure why the cast would be necessary in the macros.
enums can normally be used as integers, and the NUM_ANALOG_INPUTS is already depending on that in the calculation.
If there are some places that get warnings because of some sort of int vs unsigned int comparisons, it seems like it should be fixed there vs in the actual macro definitions.