The pin definitions have to go either in the terminal board class, or in a common class for feathers and another for non-feathers (of which the 4801 is the first instance). If we want a common methods to get the battery and usb voltage, we need virtual methods in CatenaStm32L0.h, and then override them with concrete methods at the level where the appropriate definitions are in scope. So: in CatenaStmm32L0.h, we want:
We should never have
#if
within a class definition. But we have:https://github.com/mcci-catena/Catena-Arduino-Platform/blob/04e0d4610bd51fb12038ac7e6fa36ea7cc66dd61/src/CatenaStm32L0.h#L72-L77
The pin definitions have to go either in the terminal board class, or in a common class for feathers and another for non-feathers (of which the 4801 is the first instance). If we want a common methods to get the battery and usb voltage, we need virtual methods in CatenaStm32L0.h, and then override them with concrete methods at the level where the appropriate definitions are in scope. So: in CatenaStmm32L0.h, we want:
virtual float ReadVbat(void) const = 0;
virtual float ReadVbus(void) const = 0;
For the 4801, we'll need to provide a dummy method that returns 0.0 for
ReadVbus()
.