Closed tballmsft closed 7 months ago
This is the way:
"yotta": {
"config": {
"DEVICE_BLE": 0
}
}
Unfortunately, this causes a build-error in pxt-microbit:
/home/build/prjclone/pxtapp/core/pins.cpp: In function 'void pins::pushButton(DigitalPin)':
/home/build/prjclone/pxtapp/core/pins.cpp:647:13: error: expected type-specifier before 'MicroBitButton'
new MicroBitButton((PinName)getPin((int)(pin))->name, (int)pin, MICROBIT_BUTTON_ALL_EVENTS, PinMode::PullUp)
I will investigate further.
The problem is that in lancaster/codal-microbit-v2 build
MicroBitButton.h is not included directly in MicroBit.h, but only indirectly by MicroBitButtonService.h, which is only included in MicroBit.h when DEVICE_BLE is enabled.
So, when DEVICE_BLE is not enabled, we get the compile error in pxt-microbit, which expectes MicroBitButton to always be available.
The fix for now, until codal-microbit-v2 revs is to include MicroBitButton.h in libcw/core/pins.cpp
This issue pertains to compiling for micro:bit V2 only. The BLE stack takes 30% of flash, so for large programs (like ones I am developing) that don't require BLE, this is a problem. I need a way to disable DEVICE_BLE in an extension I am developing. I have found the way to disable via yotta config, see below.