From 9b159ddaa4f3f27fccc455350df96e2ae9c35488 Mon Sep 17 00:00:00 2001 From: Liyou Zhou Date: Thu, 26 Nov 2015 13:54:20 +0000 Subject: [PATCH 1/3] Guard nordic specific implementation with #ifdef TARGET_NRF51822 --- ble/services/DFUService.h | 3 +++ source/services/DFUService.cpp | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/ble/services/DFUService.h b/ble/services/DFUService.h index 4dbec30..0f29b62 100644 --- a/ble/services/DFUService.h +++ b/ble/services/DFUService.h @@ -17,6 +17,8 @@ #ifndef __BLE_DFU_SERVICE_H__ #define __BLE_DFU_SERVICE_H__ +#ifdef TARGET_NRF51822 /* DFU only supported on nrf51 platforms */ + #include "ble/BLE.h" #include "ble/UUID.h" @@ -140,4 +142,5 @@ class DFUService { static ResetPrepare_t handoverCallback; /**< application specific handover callback. */ }; +#endif /* #ifdef TARGET_NRF51822 */ #endif /* #ifndef __BLE_DFU_SERVICE_H__*/ diff --git a/source/services/DFUService.cpp b/source/services/DFUService.cpp index a72e559..b10e24c 100644 --- a/source/services/DFUService.cpp +++ b/source/services/DFUService.cpp @@ -14,6 +14,8 @@ * limitations under the License. */ +#ifdef TARGET_NRF51822 /* DFU only supported on nrf51 platforms */ + #include "ble/services/DFUService.h" const uint8_t DFUServiceBaseUUID[] = { @@ -38,3 +40,5 @@ const uint8_t DFUServicePacketCharacteristicUUID[] = { }; DFUService::ResetPrepare_t DFUService::handoverCallback = NULL; + +#endif /* #ifdef TARGET_NRF51822 */ From f2a0a2f09e09bfd5e5534b4dfd31c203cb3393b0 Mon Sep 17 00:00:00 2001 From: Liyou Zhou Date: Thu, 26 Nov 2015 13:54:20 +0000 Subject: [PATCH 2/3] Guard nordic specific implementation with #ifdef TARGET_NRF51822 --- ble/services/DFUService.h | 3 +++ source/services/DFUService.cpp | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/ble/services/DFUService.h b/ble/services/DFUService.h index 4dbec30..7149efb 100644 --- a/ble/services/DFUService.h +++ b/ble/services/DFUService.h @@ -14,6 +14,8 @@ * limitations under the License. */ +#ifdef TARGET_NRF51822 /* DFU only supported on nrf51 platforms */ + #ifndef __BLE_DFU_SERVICE_H__ #define __BLE_DFU_SERVICE_H__ @@ -141,3 +143,4 @@ class DFUService { }; #endif /* #ifndef __BLE_DFU_SERVICE_H__*/ +#endif /* #ifdef TARGET_NRF51822 */ diff --git a/source/services/DFUService.cpp b/source/services/DFUService.cpp index a72e559..b10e24c 100644 --- a/source/services/DFUService.cpp +++ b/source/services/DFUService.cpp @@ -14,6 +14,8 @@ * limitations under the License. */ +#ifdef TARGET_NRF51822 /* DFU only supported on nrf51 platforms */ + #include "ble/services/DFUService.h" const uint8_t DFUServiceBaseUUID[] = { @@ -38,3 +40,5 @@ const uint8_t DFUServicePacketCharacteristicUUID[] = { }; DFUService::ResetPrepare_t DFUService::handoverCallback = NULL; + +#endif /* #ifdef TARGET_NRF51822 */ From ce62be1ea59b9633ba7c6241c7834ff4a131f2dc Mon Sep 17 00:00:00 2001 From: Liyou Zhou Date: Thu, 26 Nov 2015 14:24:38 +0000 Subject: [PATCH 3/3] Change position of ifdef --- ble/services/DFUService.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/ble/services/DFUService.h b/ble/services/DFUService.h index 093f445..7149efb 100644 --- a/ble/services/DFUService.h +++ b/ble/services/DFUService.h @@ -19,8 +19,6 @@ #ifndef __BLE_DFU_SERVICE_H__ #define __BLE_DFU_SERVICE_H__ -#ifdef TARGET_NRF51822 /* DFU only supported on nrf51 platforms */ - #include "ble/BLE.h" #include "ble/UUID.h" @@ -144,6 +142,5 @@ class DFUService { static ResetPrepare_t handoverCallback; /**< application specific handover callback. */ }; -#endif /* #ifdef TARGET_NRF51822 */ #endif /* #ifndef __BLE_DFU_SERVICE_H__*/ #endif /* #ifdef TARGET_NRF51822 */