From c6dcbfc670ee8c1f781ef7e61bd153dde5d91222 Mon Sep 17 00:00:00 2001 From: Rohit Grover Date: Tue, 8 Sep 2015 10:33:57 +0100 Subject: [PATCH] allow createBLEInstance to be overridable. --- source/BLE.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/BLE.cpp b/source/BLE.cpp index 7f6c5f0..22bba15 100644 --- a/source/BLE.cpp +++ b/source/BLE.cpp @@ -68,12 +68,19 @@ BLE::init() /* ... add more of the above if ever needed */ #define INITIALIZER_LIST_FOR_INSTANCE_CONSTRUCTORS(N) EXPAND(CONCATENATE(INITIALIZER_LIST_FOR_INSTANCE_CONSTRUCTORS_, N)) +#elif !defined(INITIALIZER_LIST_FOR_INSTANCE_CONSTRUCTORS) +/* + * The following applies when building without yotta. By default BLE_API provides + * a trivial initializer list containing a single constructor: createBLEInstance. + * This may be overridden. + */ +#define INITIALIZER_LIST_FOR_INSTANCE_CONSTRUCTORS createBLEInstance #endif /* YOTTA_CFG_BLE_INSTANCES_COUNT */ typedef BLEInstanceBase *(*InstanceConstructor_t)(void); static const InstanceConstructor_t instanceConstructors[BLE::NUM_INSTANCES] = { #ifndef YOTTA_CFG_BLE_INSTANCES_COUNT - createBLEInstance + INITIALIZER_LIST_FOR_INSTANCE_CONSTRUCTORS #else INITIALIZER_LIST_FOR_INSTANCE_CONSTRUCTORS(YOTTA_CFG_BLE_INSTANCES_COUNT) #endif