ST / ST_Events-old

Dependents:   HelloWorld_CCA01M1 HelloWorld_CCA02M1 CI-data-logger-server HelloWorld_CCA02M1 ... more

This is a fork of the events subdirectory of https://github.com/ARMmbed/mbed-os.

Note, you must import this library with import name: events!!!

Files at this revision

API Documentation at this revision

Comitter:
Sam Grove
Date:
Tue Sep 27 21:53:28 2016 -0700
Parent:
8151:3bd5712c8679
Parent:
8171:117683112528
Child:
8174:a7848a46e60d
Commit message:
Merge pull request #2785 from pan-/remove_warnings_from_nordic_target

TARGET_NRF - Remove warnings from nordic target.

Changed in this revision

--- a/features/FEATURE_BLE/ble/deprecate.h	Tue Sep 27 21:52:57 2016 -0700
+++ b/features/FEATURE_BLE/ble/deprecate.h	Tue Sep 27 21:53:28 2016 -0700
@@ -23,4 +23,4 @@
 	#define __deprecated_message(msg)
 #endif
 
-#endif
\ No newline at end of file
+#endif
--- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/sdk/source/ble/common/ble_conn_state.c	Tue Sep 27 21:52:57 2016 -0700
+++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/sdk/source/ble/common/ble_conn_state.c	Tue Sep 27 21:53:28 2016 -0700
@@ -169,7 +169,7 @@
                                    m_bcs.valid_conn_handles,
                                  (~m_bcs.flags.connected_flags) & (m_bcs.flags.valid_flags));
 
-    for (int i = 0; i < disconnected_list.len; i++)
+    for (uint32_t i = 0; i < disconnected_list.len; i++)
     {
         record_invalidate(disconnected_list.flag_keys[i]);
     }
--- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/sdk/source/ble/peer_manager/peer_database.c	Tue Sep 27 21:52:57 2016 -0700
+++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/sdk/source/ble/peer_manager/peer_database.c	Tue Sep 27 21:53:28 2016 -0700
@@ -172,7 +172,7 @@
  */
 static void write_buffer_record_release(pdb_buffer_record_t * p_write_buffer_record)
 {
-    for (int i = 0; i < p_write_buffer_record->n_bufs; i++)
+    for (uint32_t i = 0; i < p_write_buffer_record->n_bufs; i++)
     {
         pm_buffer_release(&m_pdb.write_buffer, p_write_buffer_record->buffer_block_id + i);
     }
--- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/sdk/source/ble/peer_manager/pm_buffer.c	Tue Sep 27 21:52:57 2016 -0700
+++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/sdk/source/ble/peer_manager/pm_buffer.c	Tue Sep 27 21:53:28 2016 -0700
@@ -93,7 +93,7 @@
             {
                 first_locked_mutex = i;
             }
-            if ((i - first_locked_mutex + 1) == n_blocks)
+            if ((i - first_locked_mutex + 1) >= 0 && ((uint32_t)(i - first_locked_mutex + 1)) == n_blocks)
             {
                 return first_locked_mutex;
             }
--- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/sdk/source/drivers_nrf/delay/nrf_delay.h	Tue Sep 27 21:52:57 2016 -0700
+++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/sdk/source/drivers_nrf/delay/nrf_delay.h	Tue Sep 27 21:53:28 2016 -0700
@@ -191,8 +191,8 @@
 
 #elif defined ( __GNUC__ )
 
-static void __INLINE nrf_delay_us(uint32_t volatile number_of_us) __attribute__((always_inline));
-static void __INLINE nrf_delay_us(uint32_t volatile number_of_us)
+static __INLINE void nrf_delay_us(uint32_t volatile number_of_us) __attribute__((always_inline));
+static __INLINE void nrf_delay_us(uint32_t volatile number_of_us)
 {
 register uint32_t delay __ASM ("r0") = number_of_us;
 __ASM volatile (
--- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/sdk/source/libraries/fds/fds.c	Tue Sep 27 21:52:57 2016 -0700
+++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/sdk/source/libraries/fds/fds.c	Tue Sep 27 21:53:28 2016 -0700
@@ -40,6 +40,10 @@
 #include "nrf_error.h"
 #include "app_util.h"
 
+static void fs_callback(uint8_t             op_code,
+                        uint32_t            result,
+                        uint32_t    const * p_data,
+                        fs_length_t         length_words);
 
 /** Our fstorage configuration.
  *  The other fields will be assigned automatically during compilation. */
--- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/sdk/source/libraries/fds/fds_types_internal.h	Tue Sep 27 21:52:57 2016 -0700
+++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/sdk/source/libraries/fds/fds_types_internal.h	Tue Sep 27 21:53:28 2016 -0700
@@ -68,7 +68,7 @@
 #define FDS_CMD_QUEUE_SIZE_GC       (1)
 
 
-static uint8_t m_nested_critical;
+//static uint8_t m_nested_critical;
 
 /** Macros to enable and disable application interrupts. */
 #define CRITICAL_SECTION_ENTER()    //sd_nvic_critical_region_enter(&m_nested_critical)
--- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/sdk/source/libraries/fstorage/fstorage.c	Tue Sep 27 21:52:57 2016 -0700
+++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/sdk/source/libraries/fstorage/fstorage.c	Tue Sep 27 21:53:28 2016 -0700
@@ -559,7 +559,7 @@
     printf("Num items: 0x%08lx\r\n",        (unsigned long)FS_SECTION_VARS_COUNT);
     printf("===== ITEMS %lu =====\r\n",     (unsigned long)FS_SECTION_VARS_COUNT);
 
-    for(int i = 0; i < FS_SECTION_VARS_COUNT; i++)
+    for(uint32_t i = 0; i < FS_SECTION_VARS_COUNT; i++)
     {
         fs_config_t* config = FS_SECTION_VARS_GET(i);
         printf( "Address: 0x%08lx, CB: 0x%08lx\r\n",
--- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/sdk/source/libraries/fstorage/fstorage.h	Tue Sep 27 21:52:57 2016 -0700
+++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/sdk/source/libraries/fstorage/fstorage.h	Tue Sep 27 21:53:28 2016 -0700
@@ -74,23 +74,6 @@
                         fs_length_t         length_words);
 
 
-/**@brief Function prototype for a callback handler.
- *
- * @details This function is expected to be implemented by the module that 
- *          registers for fstorage usage. Its usage is described
- *          in the function pointer type fs_cb_t.
- *
- * @param[in]   op_code         Flash operation code.
- * @param[in]   result          Result of the flash operation.
- * @param[in]   p_data          Pointer to the resulting data (or NULL if not in use).
- * @param[in]   length_words    Length of data in words.
- */
-static void fs_callback(uint8_t             op_code,
-                        uint32_t            result,
-                        uint32_t    const * p_data,
-                        fs_length_t         length_words);
-
-
 /**@brief Flash storage config variable.
  *
  * @details     The fstorage module will update the start_addr and end_address according to 
--- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/sdk/source/libraries/util/app_util_platform.h	Tue Sep 27 21:52:57 2016 -0700
+++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/sdk/source/libraries/util/app_util_platform.h	Tue Sep 27 21:53:28 2016 -0700
@@ -68,8 +68,6 @@
 #define EXTERNAL_INT_VECTOR_OFFSET 16
 /**@endcond */
 
-#define PACKED(TYPE) __packed TYPE
-
 void critical_region_enter (void);
 void critical_region_exit (void);
 
--- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/sdk/source/libraries/util/sdk_mapped_flags.c	Tue Sep 27 21:52:57 2016 -0700
+++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/sdk/source/libraries/util/sdk_mapped_flags.c	Tue Sep 27 21:53:28 2016 -0700
@@ -111,7 +111,7 @@
         {
             if (p_keys[i] == key)
             {
-                for (int j = 0; j < n_flag_collections; j++)
+                for (uint32_t j = 0; j < n_flag_collections; j++)
                 {
                     if (value)
                     {
--- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/sdk/source/softdevice/s130/headers/nrf_svc.h	Tue Sep 27 21:52:57 2016 -0700
+++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/sdk/source/softdevice/s130/headers/nrf_svc.h	Tue Sep 27 21:53:28 2016 -0700
@@ -42,11 +42,11 @@
 #define SVCALL(number, return_type, signature) return_type __svc(number) signature
 #elif defined (__GNUC__)
 #define SVCALL(number, return_type, signature) \
-  _Pragma("GCC diagnostic ignored \"-Wunused-function\"") \
-  _Pragma("GCC diagnostic ignored \"-Wunused-parameter\"") \
   _Pragma("GCC diagnostic push") \
   _Pragma("GCC diagnostic ignored \"-Wreturn-type\"") \
-  __attribute__((naked)) static return_type signature \
+  __attribute__((naked))                                \
+  __attribute__((unused))                               \
+  static return_type signature                          \
   { \
     __asm( \
         "svc %0\n" \
--- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/source/btle/btle.cpp	Tue Sep 27 21:52:57 2016 -0700
+++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/source/btle/btle.cpp	Tue Sep 27 21:53:28 2016 -0700
@@ -234,7 +234,7 @@
 /*! @brief      Callback when an error occurs inside the SoftDevice */
 void assert_nrf_callback(uint16_t line_num, const uint8_t *p_file_name)
 {
-    ASSERT(false, (void) 0);
+    ASSERT_TRUE(false, (void) 0);
 }
 
 /*!
--- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/source/btle/btle_discovery.cpp	Tue Sep 27 21:52:57 2016 -0700
+++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/source/btle/btle_discovery.cpp	Tue Sep 27 21:53:28 2016 -0700
@@ -23,7 +23,6 @@
 void bleGattcEventHandler(const ble_evt_t *p_ble_evt)
 {
     nRF5xn                &ble         = nRF5xn::Instance(BLE::DEFAULT_INSTANCE);
-    nRF5xGap              &gap         = (nRF5xGap &) ble.getGap();
     nRF5xGattClient       &gattClient  = (nRF5xGattClient &) ble.getGattClient();
     nRF5xServiceDiscovery &sdSingleton = gattClient.discovery();
     nRF5xCharacteristicDescriptorDiscoverer &characteristicDescriptorDiscoverer =
--- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/source/btle/custom/custom_helper.cpp	Tue Sep 27 21:52:57 2016 -0700
+++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/source/btle/custom/custom_helper.cpp	Tue Sep 27 21:53:28 2016 -0700
@@ -135,7 +135,7 @@
     #define CFG_CUSTOM_UUID_BASE  "\x6E\x40\x00\x00\xB5\xA3\xF3\x93\xE0\xA9\xE5\x0E\x24\xDC\xCA\x9E"
 
     uint8_t uuid_type = custom_add_uuid_base(CFG_CUSTOM_UUID_BASE);
-    ASSERT(uuid_type > 0, ERROR_NOT_FOUND);
+    ASSERT_TRUE(uuid_type > 0, ERROR_NOT_FOUND);
 
     // We can now safely add the primary service and any characteristics
     // for our custom service ...
--- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/source/common/assertion.h	Tue Sep 27 21:52:57 2016 -0700
+++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/source/common/assertion.h	Tue Sep 27 21:53:28 2016 -0700
@@ -125,7 +125,6 @@
 //--------------------------------------------------------------------+
 // Logical Assert
 //--------------------------------------------------------------------+
-#define ASSERT(...)                      ASSERT_TRUE(__VA_ARGS__)
 #define ASSERT_TRUE(condition  , error)  ASSERT_DEFINE( , (condition), error, "%s", "evaluated to false")
 #define ASSERT_FALSE(condition , error)  ASSERT_DEFINE( ,!(condition), error, "%s", "evaluated to true")
 
--- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/source/nRF5xGap.cpp	Tue Sep 27 21:52:57 2016 -0700
+++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/source/nRF5xGap.cpp	Tue Sep 27 21:53:28 2016 -0700
@@ -96,7 +96,7 @@
     //}
 
     /* Send advertising data! */
-    ASSERT(ERROR_NONE ==
+    ASSERT_TRUE(ERROR_NONE ==
            sd_ble_gap_adv_data_set(advData.getPayload(),
                                    advData.getPayloadLen(),
                                    scanResponse.getPayload(),
@@ -105,7 +105,7 @@
 
     /* Make sure the GAP Service appearance value is aligned with the
      *appearance from GapAdvertisingData */
-    ASSERT(ERROR_NONE == sd_ble_gap_appearance_set(advData.getAppearance()),
+    ASSERT_TRUE(ERROR_NONE == sd_ble_gap_appearance_set(advData.getAppearance()),
            BLE_ERROR_PARAM_OUT_OF_RANGE);
 
     /* ToDo: Perform some checks on the payload, for example the Scan Response can't */
@@ -196,7 +196,7 @@
     adv_para.interval    = params.getIntervalInADVUnits(); // advertising interval (in units of 0.625 ms)
     adv_para.timeout     = params.getTimeout();
 
-    ASSERT(ERROR_NONE == sd_ble_gap_adv_start(&adv_para), BLE_ERROR_PARAM_OUT_OF_RANGE);
+    ASSERT_TRUE(ERROR_NONE == sd_ble_gap_adv_start(&adv_para), BLE_ERROR_PARAM_OUT_OF_RANGE);
 
     return BLE_ERROR_NONE;
 }
@@ -267,7 +267,7 @@
 ble_error_t nRF5xGap::stopAdvertising(void)
 {
     /* Stop Advertising */
-    ASSERT(ERROR_NONE == sd_ble_gap_adv_stop(), BLE_ERROR_PARAM_OUT_OF_RANGE);
+    ASSERT_TRUE(ERROR_NONE == sd_ble_gap_adv_stop(), BLE_ERROR_PARAM_OUT_OF_RANGE);
 
     state.advertising = 0;
 
--- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/source/nRF5xGap.h	Tue Sep 27 21:52:57 2016 -0700
+++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/source/nRF5xGap.h	Tue Sep 27 21:53:28 2016 -0700
@@ -220,7 +220,7 @@
      */
     void processRadioNotificationEvent(bool param) {
         radioNotificationCallbackParam = param;
-        radioNotificationTimeout.attach_us(this, &nRF5xGap::postRadioNotificationCallback, 0);
+        radioNotificationTimeout.attach_us(mbed::callback(this, &nRF5xGap::postRadioNotificationCallback), 0);
     }
     friend void radioNotificationStaticCallback(bool param); /* allow invocations of processRadioNotificationEvent() */
 
--- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/source/nRF5xGattServer.cpp	Tue Sep 27 21:52:57 2016 -0700
+++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/source/nRF5xGattServer.cpp	Tue Sep 27 21:53:28 2016 -0700
@@ -52,7 +52,7 @@
     nordicUUID = custom_convert_to_nordic_uuid(service.getUUID());
 
     uint16_t serviceHandle;
-    ASSERT( ERROR_NONE ==
+    ASSERT_TRUE( ERROR_NONE ==
             sd_ble_gatts_service_add(BLE_GATTS_SRVC_TYPE_PRIMARY,
                                      &nordicUUID,
                                      &serviceHandle),
@@ -88,7 +88,7 @@
             }
         }
 
-        ASSERT ( ERROR_NONE ==
+        ASSERT_TRUE ( ERROR_NONE ==
                  custom_add_in_characteristic(BLE_GATT_HANDLE_INVALID,
                                               &nordicUUID,
                                               p_char->getProperties(),
@@ -123,7 +123,7 @@
 
             nordicUUID = custom_convert_to_nordic_uuid(p_desc->getUUID());
 
-            ASSERT(ERROR_NONE ==
+            ASSERT_TRUE(ERROR_NONE ==
                    custom_add_in_descriptor(BLE_GATT_HANDLE_INVALID,
                                             &nordicUUID,
                                             p_desc->getValuePtr(),
@@ -177,7 +177,7 @@
         .p_value = buffer,
     };
 
-    ASSERT( ERROR_NONE ==
+    ASSERT_TRUE( ERROR_NONE ==
             sd_ble_gatts_value_get(connectionHandle, attributeHandle, &value),
             BLE_ERROR_PARAM_OUT_OF_RANGE);
     *lengthP = value.len;
--- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle.cpp	Tue Sep 27 21:52:57 2016 -0700
+++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle.cpp	Tue Sep 27 21:53:28 2016 -0700
@@ -292,7 +292,7 @@
 /*! @brief      Callback when an error occurs inside the SoftDevice */
 void assert_nrf_callback(uint16_t line_num, const uint8_t *p_file_name)
 {
-    ASSERT(false, (void) 0);
+    ASSERT_TRUE(false, (void) 0);
 }
 
 /*!
--- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/common/assertion.h	Tue Sep 27 21:52:57 2016 -0700
+++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/common/assertion.h	Tue Sep 27 21:53:28 2016 -0700
@@ -125,7 +125,6 @@
 //--------------------------------------------------------------------+
 // Logical Assert
 //--------------------------------------------------------------------+
-#define ASSERT(...)                      ASSERT_TRUE(__VA_ARGS__)
 #define ASSERT_TRUE(condition  , error)  ASSERT_DEFINE( , (condition), error, "%s", "evaluated to false")
 #define ASSERT_FALSE(condition , error)  ASSERT_DEFINE( ,!(condition), error, "%s", "evaluated to true")
 
--- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xGap.cpp	Tue Sep 27 21:52:57 2016 -0700
+++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xGap.cpp	Tue Sep 27 21:53:28 2016 -0700
@@ -96,7 +96,7 @@
     //}
 
     /* Send advertising data! */
-    ASSERT(ERROR_NONE ==
+    ASSERT_TRUE(ERROR_NONE ==
            sd_ble_gap_adv_data_set(advData.getPayload(),
                                    advData.getPayloadLen(),
                                    scanResponse.getPayload(),
@@ -105,7 +105,7 @@
 
     /* Make sure the GAP Service appearance value is aligned with the
      *appearance from GapAdvertisingData */
-    ASSERT(ERROR_NONE == sd_ble_gap_appearance_set(advData.getAppearance()),
+    ASSERT_TRUE(ERROR_NONE == sd_ble_gap_appearance_set(advData.getAppearance()),
            BLE_ERROR_PARAM_OUT_OF_RANGE);
 
     /* ToDo: Perform some checks on the payload, for example the Scan Response can't */
@@ -273,7 +273,7 @@
 ble_error_t nRF5xGap::stopAdvertising(void)
 {
     /* Stop Advertising */
-    ASSERT(ERROR_NONE == sd_ble_gap_adv_stop(), BLE_ERROR_PARAM_OUT_OF_RANGE);
+    ASSERT_TRUE(ERROR_NONE == sd_ble_gap_adv_stop(), BLE_ERROR_PARAM_OUT_OF_RANGE);
 
     state.advertising = 0;
 
--- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xGap.h	Tue Sep 27 21:52:57 2016 -0700
+++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xGap.h	Tue Sep 27 21:53:28 2016 -0700
@@ -221,7 +221,7 @@
      */
     void processRadioNotificationEvent(bool param) {
         radioNotificationCallbackParam = param;
-        radioNotificationTimeout.attach_us(this, &nRF5xGap::postRadioNotificationCallback, 0);
+        radioNotificationTimeout.attach_us(mbed::callback(this, &nRF5xGap::postRadioNotificationCallback), 0);
     }
     friend void radioNotificationStaticCallback(bool param); /* allow invocations of processRadioNotificationEvent() */
 
--- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xGattServer.cpp	Tue Sep 27 21:52:57 2016 -0700
+++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xGattServer.cpp	Tue Sep 27 21:53:28 2016 -0700
@@ -52,7 +52,7 @@
     nordicUUID = custom_convert_to_nordic_uuid(service.getUUID());
 
     uint16_t serviceHandle;
-    ASSERT( ERROR_NONE ==
+    ASSERT_TRUE( ERROR_NONE ==
             sd_ble_gatts_service_add(BLE_GATTS_SRVC_TYPE_PRIMARY,
                                      &nordicUUID,
                                      &serviceHandle),
@@ -88,7 +88,7 @@
             }
         }
 
-        ASSERT ( ERROR_NONE ==
+        ASSERT_TRUE ( ERROR_NONE ==
                  custom_add_in_characteristic(BLE_GATT_HANDLE_INVALID,
                                               &nordicUUID,
                                               p_char->getProperties(),
@@ -123,7 +123,7 @@
 
             nordicUUID = custom_convert_to_nordic_uuid(p_desc->getUUID());
 
-            ASSERT(ERROR_NONE ==
+            ASSERT_TRUE(ERROR_NONE ==
                    custom_add_in_descriptor(BLE_GATT_HANDLE_INVALID,
                                             &nordicUUID,
                                             p_desc->getValuePtr(),
@@ -177,7 +177,7 @@
         .p_value = buffer,
     };
 
-    ASSERT( ERROR_NONE ==
+    ASSERT_TRUE( ERROR_NONE ==
             sd_ble_gatts_value_get(connectionHandle, attributeHandle, &value),
             BLE_ERROR_PARAM_OUT_OF_RANGE);
     *lengthP = value.len;
--- a/hal/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/nrf_delay.h	Tue Sep 27 21:52:57 2016 -0700
+++ b/hal/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/nrf_delay.h	Tue Sep 27 21:53:28 2016 -0700
@@ -45,7 +45,7 @@
        " BNE loop\n\t");
 }
 #elif defined   (  __GNUC__  )
-__INLINE static void nrf_delay_us(uint32_t volatile number_of_us)
+static __INLINE void nrf_delay_us(uint32_t volatile number_of_us)
 {
     do 
     {
--- a/hal/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/spi_api.c	Tue Sep 27 21:52:57 2016 -0700
+++ b/hal/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/spi_api.c	Tue Sep 27 21:53:28 2016 -0700
@@ -32,7 +32,7 @@
 
 void spi_init(spi_t *obj, PinName mosi, PinName miso, PinName sclk, PinName ssel)
 {
-    SPIName spi;
+    SPIName spi = SPI_0;
     
     if (ssel == NC && i2c0_spi0_peripheral.usage == I2C_SPI_PERIPHERAL_FOR_SPI &&
             i2c0_spi0_peripheral.sda_mosi == (uint8_t)mosi &&
--- a/hal/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/us_ticker.c	Tue Sep 27 21:52:57 2016 -0700
+++ b/hal/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/us_ticker.c	Tue Sep 27 21:53:28 2016 -0700
@@ -588,6 +588,4 @@
 
         return clock_cycles_by_tick - ((current_counter - next_tick_cc_value) % clock_cycles_by_tick);
     }
-
-    return 0;
 }
--- a/hal/targets/hal/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/pm_buffer.c	Tue Sep 27 21:52:57 2016 -0700
+++ b/hal/targets/hal/TARGET_NORDIC/TARGET_NRF5/sdk/ble/peer_manager/pm_buffer.c	Tue Sep 27 21:53:28 2016 -0700
@@ -100,7 +100,7 @@
             {
                 first_locked_mutex = i;
             }
-            if ((i - first_locked_mutex + 1) == n_blocks)
+            if ((i - first_locked_mutex + 1) >= 0 && ((uint32_t) (i - first_locked_mutex + 1)) == n_blocks)
             {
                 return first_locked_mutex;
             }
--- a/hal/targets/hal/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/delay/nrf_delay.h	Tue Sep 27 21:52:57 2016 -0700
+++ b/hal/targets/hal/TARGET_NORDIC/TARGET_NRF5/sdk/drivers_nrf/delay/nrf_delay.h	Tue Sep 27 21:53:28 2016 -0700
@@ -159,8 +159,8 @@
 
 #elif defined ( __GNUC__ )
 
-static void __INLINE nrf_delay_us(uint32_t volatile number_of_us) __attribute__((always_inline));
-static void __INLINE nrf_delay_us(uint32_t volatile number_of_us)
+static __INLINE void nrf_delay_us(uint32_t volatile number_of_us) __attribute__((always_inline));
+static __INLINE void nrf_delay_us(uint32_t volatile number_of_us)
 {
 register uint32_t delay __ASM ("r0") = number_of_us;
 __ASM volatile (
--- a/hal/targets/hal/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/pwm/app_pwm.c	Tue Sep 27 21:52:57 2016 -0700
+++ b/hal/targets/hal/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/pwm/app_pwm.c	Tue Sep 27 21:53:28 2016 -0700
@@ -375,10 +375,10 @@
 
 #ifdef NRF52
     if (ticks + ((nrf_timer_frequency_get(p_instance->p_timer->p_reg) == 
-        (m_use_ppi_delay_workaround ? NRF_TIMER_FREQ_8MHz : NRF_TIMER_FREQ_16MHz) ) ? 1 : 0)
+        (m_use_ppi_delay_workaround ? NRF_TIMER_FREQ_8MHz : NRF_TIMER_FREQ_16MHz) ) ? 1U : 0U)
         < p_ch_cb->pulsewidth)
 #else
-    if (ticks + ((nrf_timer_frequency_get(p_instance->p_timer->p_reg) == NRF_TIMER_FREQ_16MHz) ? 1 : 0)
+    if (ticks + ((nrf_timer_frequency_get(p_instance->p_timer->p_reg) == NRF_TIMER_FREQ_16MHz) ? 1U : 0U)
         < p_ch_cb->pulsewidth)
 #endif
     {
--- a/hal/targets/hal/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/app_util_platform.h	Tue Sep 27 21:52:57 2016 -0700
+++ b/hal/targets/hal/TARGET_NORDIC/TARGET_NRF5/sdk/libraries/util/app_util_platform.h	Tue Sep 27 21:53:28 2016 -0700
@@ -111,10 +111,6 @@
 #define EXTERNAL_INT_VECTOR_OFFSET 16
 /**@endcond */
 
-#ifndef PACKED
-    #define PACKED(TYPE) __packed TYPE
-#endif
-
 void app_util_critical_region_enter (uint8_t *p_nested);
 void app_util_critical_region_exit (uint8_t nested);
 
--- a/hal/targets/hal/TARGET_NORDIC/TARGET_NRF5/serial_api.c	Tue Sep 27 21:52:57 2016 -0700
+++ b/hal/targets/hal/TARGET_NORDIC/TARGET_NRF5/serial_api.c	Tue Sep 27 21:53:28 2016 -0700
@@ -310,7 +310,7 @@
         nrf_uart_configure(UART_INSTANCE, UART_CB.parity, UART_CB.hwfc);
         if (UART_CB.hwfc == NRF_UART_HWFC_ENABLED) {
             serial_set_flow_control(obj, FlowControlRTSCTS,
-                UART_CB.pselrts, UART_CB.pselcts);
+                (PinName) UART_CB.pselrts, (PinName) UART_CB.pselcts);
         }
         nrf_uart_enable(UART_INSTANCE);
 
--- a/hal/targets/hal/TARGET_NORDIC/TARGET_NRF5/us_ticker.c	Tue Sep 27 21:52:57 2016 -0700
+++ b/hal/targets/hal/TARGET_NORDIC/TARGET_NRF5/us_ticker.c	Tue Sep 27 21:53:28 2016 -0700
@@ -284,7 +284,7 @@
     push {r3, lr}
     bl common_rtc_irq_handler
     pop {r3, pc}
-    nop /* padding */
+    ; ALIGN ;
 }
 
 #elif defined (__GNUC__)        /* GNU Compiler */