diff --git a/libraries/BLE/aci_queue.cpp b/libraries/BLE/aci_queue.cpp index 48deda5..c191c8b 100644 --- a/libraries/BLE/aci_queue.cpp +++ b/libraries/BLE/aci_queue.cpp @@ -78,6 +78,7 @@ bool aci_queue_enqueue(aci_queue_t *aci_q, hal_aci_data_t *p_data) { const uint8_t length = p_data->buffer[0]; + ble_assert(length <= HAL_ACI_MAX_LENGTH); ble_assert(NULL != aci_q); ble_assert(NULL != p_data); @@ -97,8 +98,9 @@ bool aci_queue_enqueue_from_isr(aci_queue_t *aci_q, hal_aci_data_t *p_data) { const uint8_t length = p_data->buffer[0]; - ble_assert(NULL != aci_q); - ble_assert(NULL != p_data); + ble_assert_isr(length <= HAL_ACI_MAX_LENGTH); + ble_assert_isr(NULL != aci_q); + ble_assert_isr(NULL != p_data); if (aci_queue_is_full_from_isr(aci_q)) { diff --git a/libraries/BLE/ble_assert.h b/libraries/BLE/ble_assert.h index d6e3394..9b714be 100644 --- a/libraries/BLE/ble_assert.h +++ b/libraries/BLE/ble_assert.h @@ -27,10 +27,16 @@ #define BLE_ASSERT_H__ extern void __ble_assert(const char *file, uint16_t line); +extern void __ble_assert_isr(); #define ble_assert(expr) \ ((expr) \ ? ((void) 0) \ : __ble_assert (__FILE__, __LINE__)) +#define ble_assert_isr(expr) \ + ((expr) \ + ? ((void) 0) \ + : __ble_assert_isr ()) + #endif /* BLE_ASSERT_H__ */ \ No newline at end of file