In mpconfig.h, use #define's to enable or disable each native module. These can then be enabled/disabled by port or board, instead of the hodgepodge of #define's that we have now (e.g. PIRKEY_M0, etc.).
For example, create CIRCUITPY_BUSIO, CIRCUITPY_ANALOGIO, etc.
Once this has been done, we can also refactor all the xxx_reset() operations so they are done at the module level. So for instance in port.c or even main.c we can do
#if CIRCUITPY_BUSIO
busio_reset()
#endif
busio_reset() would be defined in common-hal/busio/__init__.c and would call i2c_reset(), spi_reset(), etc. as necessary.
In
mpconfig.h, use#define's to enable or disable each native module. These can then be enabled/disabled by port or board, instead of the hodgepodge of#define's that we have now (e.g.PIRKEY_M0, etc.).For example, create
CIRCUITPY_BUSIO,CIRCUITPY_ANALOGIO, etc.Once this has been done, we can also refactor all the
xxx_reset()operations so they are done at the module level. So for instance inport.cor evenmain.cwe can dobusio_reset()would be defined incommon-hal/busio/__init__.cand would calli2c_reset(),spi_reset(), etc. as necessary.