aa

Dependents:   Peripheral_1_serial_copy Peripheral_1_serial 151006_1st_Scenario_normal

Fork of BLE_API by Bluetooth Low Energy

Revision:
828:a63b24d78132
Parent:
826:b65c6a222525
Child:
829:d22ab1419e92
diff -r 00415ff9e2a7 -r a63b24d78132 source/BLE.cpp
--- a/source/BLE.cpp	Tue Sep 29 09:54:17 2015 +0100
+++ b/source/BLE.cpp	Tue Sep 29 09:54:17 2015 +0100
@@ -68,12 +68,19 @@
 /* ... 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