Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions libraries/BLE/aci_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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))
{
Expand Down
6 changes: 6 additions & 0 deletions libraries/BLE/ble_assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__ */