Merge pull request #382 from microbit-sam/pf-yt-toggle

Use config.json to enable / disable Partial Flashing Service
This commit is contained in:
Joe Finney 2018-09-07 17:55:41 +01:00 committed by GitHub
commit 34e46f04e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 0 deletions

View file

@ -303,6 +303,14 @@ extern uint32_t __etext;
#define MICROBIT_BLE_DEVICE_INFORMATION_SERVICE 1
#endif
// Enable/Disable BLE Service: MicroBitPartialFlashingService
// This enables the flashing part of the partial flashing service.
// Partial flashing is currently only possible for programs built using MakeCode
// and is disabled by default.
#ifndef MICROBIT_BLE_PARTIAL_FLASHING
#define MICROBIT_BLE_PARTIAL_FLASHING 0
#endif
//
// Accelerometer options
//

View file

@ -125,6 +125,10 @@
#define MICROBIT_BLE_ADVERTISING_INTERVAL YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_ADVERTISING_INTERVAL
#endif
#ifdef YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_PARTIAL_FLASHING
#define MICROBIT_BLE_PARTIAL_FLASHING YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_PARTIAL_FLASHING
#endif
//we check if the user has requested open mode, otherwise we will double def!
#if (YOTTA_CFG_MICROBIT_DAL_BLUETOOTH_OPEN == 0)

View file

@ -383,6 +383,9 @@ void MicroBitBLEManager::init(ManagedString deviceName, ManagedString serialNumb
// Bring up core BLE services.
#if CONFIG_ENABLED(MICROBIT_BLE_DFU_SERVICE)
new MicroBitDFUService(*ble);
#endif
#if CONFIG_ENABLED(MICROBIT_BLE_PARTIAL_FLASHING)
new MicroBitPartialFlashingService(*ble, messageBus);
#endif