Skip to content

Do not call possible blocking call from ISR. #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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__ */