Open microbit-carlos opened 1 year ago
Apart from that there is also this validateBootloaderSettings()
run with DEVICE_BLE
only:
The design comes from the DAL. https://github.com/lancaster-university/microbit/blob/master/inc/MicroBit.h#L123 https://github.com/lancaster-university/microbit/blob/master/source/MicroBit.cpp#L82
DEVICE_BLE is new in CODAL. It came about because early CODAL versions had NO_BLE, used to temporarily exclude all BLE code inherited from the DAL.
Note that bleManager is at the top of the uBit member variable list because of this. https://github.com/lancaster-university/codal-microbit-v2/blob/master/source/bluetooth/MicroBitBLEManager.cpp#L178
Oh right, thanks Martin!
Also important to note that the "no soft device" mode is now configured by setting DEVICE_BLE
to 0. In that case it also excludes SD all BLE related code, probably similarly to how NO_BLE
used to work.
Yes DEVICE_BLE is NO_BLE renamed and with reversed logic. We weren't really sure that we needed to keep DEVICE_BLE, but it looks like we chose right! https://github.com/microbit-foundation/codal-microbit/pull/50/files/675d948a25da50c688cc68ce5f788975fb44f006#diff-4ec23bebe492b0ab02ca146f33e70404abb3cb5735d87ef322f35523bac18fbd (private)
MicroBit.h/.cpp declares and initialises
MicroBitBLEManager
andBLEDevice
instances only checking for theDEVICE_BLE
config flag only: https://github.com/lancaster-university/codal-microbit-v2/blob/dfc0adc6fb820c965ee5913e0650ff5baaa438e9/model/MicroBit.h#L148-L153 https://github.com/lancaster-university/codal-microbit-v2/blob/dfc0adc6fb820c965ee5913e0650ff5baaa438e9/model/MicroBit.cpp#L58-L61But then it only runs the
bleManager.init()
ifMICROBIT_BLE_ENABLED
is enabled as well: https://github.com/lancaster-university/codal-microbit-v2/blob/dfc0adc6fb820c965ee5913e0650ff5baaa438e9/model/MicroBit.cpp#L281-L284I assume this is by design, as maybe the classes need to be instantiated for other BLE configuration (maybe partial flashing as well?), but
bleManager.init()
is only needed if we wanted to start other services ? Just wanted to double check this is correct.