I have EXTREMELY limited programming experience but am working on a custom Micropython build. A feature is enabled/disabled using a #define
statement in a C header file e.g. #define MICROPY_HW_USB_MSC (1);
I would like to make this dynamic as part of the code build.
This defines whether the MCU supports USB Mass Storage at runtime. What I would like to do is to set this variable (?) from a script (or some other recommended means) that reads the state of a GPI pin on the MCU at boot.
So if the pin is low, it effectively creates #define MICROPY_HW_USB_MSC (0)
, and conversely if the pin is high, #define MICROPY_HW_USB_MSC (1)
.
I hope this makes sense and thanks in advance for any assistance.
I have tried searching for a solution online but am not experienced enough to search for the correct terminology - hence turning to experts for assistance.