Bluetooth: Controller: Use BT_ASSERT instead of custom impl.

As part of closer integration into Zephyr, remove the use
of custom assert mechanism and use BT_ASSERT instead.

Jira: ZEP-761

Change-id: I27f37d697b0a84bc001754a8d0b4dbb6ddb54298
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
This commit is contained in:
Vinayak Chettimada 2016-09-08 18:08:58 +02:00 committed by Johan Hedberg
commit e00eed79aa
10 changed files with 192 additions and 215 deletions

View file

@ -92,14 +92,14 @@ hf_start_return:
/* rollover should not happen as start and stop shall be
* called in pairs.
*/
ASSERT(clock_instance.m16src_refcount);
BT_ASSERT(clock_instance.m16src_refcount);
return (((NRF_CLOCK->HFCLKSTAT & CLOCK_HFCLKSTAT_STATE_Msk)) ? 1 : 0);
}
void clock_m16src_stop(void)
{
ASSERT(clock_instance.m16src_refcount);
BT_ASSERT(clock_instance.m16src_refcount);
if (--clock_instance.m16src_refcount) {
return;
@ -183,7 +183,7 @@ void power_clock_isr(void)
done = (NRF_CLOCK->EVENTS_DONE != 0);
ctto = (NRF_CLOCK->EVENTS_CTTO != 0);
ASSERT(pof || hf || lf || done || ctto);
BT_ASSERT(pof || hf || lf || done || ctto);
if (pof) {
NRF_POWER->EVENTS_POFWARN = 0;
@ -203,7 +203,7 @@ void power_clock_isr(void)
if (lf) {
NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
ASSERT(0);
BT_ASSERT(0);
}
if (done) {

View file

@ -18,30 +18,13 @@
#ifndef _DEBUG_H_
#define _DEBUG_H_
#ifdef __GNUC__
#define ASSERT(x) do { \
if (!(x)) { \
__asm__ volatile (".inst 0xde00\n"); \
} \
} while (0)
#else
static __asm void _udf(void)
{
UND #0;
}
#include <bluetooth/log.h>
#define ASSERT(x) do { \
if (!(x)) { \
_udf(); \
} \
} while (0)
#endif
#if (DEBUG == 1)
/*
* P2 is outgoing debug pins.
* Debug pins are initialized to low.
/* below are some interesting macros referenced by controller
* which can be defined to SoC's GPIO toggle to observe/debug the
* controller's runtime behavior.
*/
#if (DEBUG == 1)
#define DEBUG_INIT() do { \
NRF_GPIO->DIRSET = 0x03FF0000; \
NRF_GPIO->OUTCLR = 0x03FF0000; } \

View file

@ -125,7 +125,7 @@ void ecb_isr(void)
}
else {
ASSERT(0);
BT_ASSERT(0);
}
}

View file

@ -483,7 +483,7 @@ void *radio_ccm_tx_pkt_set(struct ccm *ccm, void *pkt)
NRF_CCM->INTENCLR = CCM_INTENCLR_ENDCRYPT_Msk;
NVIC_ClearPendingIRQ(CCM_AAR_IRQn);
ASSERT(NRF_CCM->EVENTS_ERROR == 0);
BT_ASSERT(NRF_CCM->EVENTS_ERROR == 0);
#else
/* start KSGEN early, but dont wait for ENDCRYPT */
NRF_CCM->TASKS_KSGEN = 1;

View file

@ -33,7 +33,7 @@ static struct rand *_rand;
void rand_init(uint8_t *context, uint8_t context_len)
{
ASSERT(context_len > sizeof(struct rand));
BT_ASSERT(context_len > sizeof(struct rand));
_rand = (struct rand *)context;
_rand->count = context_len - sizeof(struct rand) + 1;

View file

@ -46,7 +46,7 @@ uint32_t rtc_start(void)
uint32_t rtc_stop(void)
{
ASSERT(_rtc_refcount);
BT_ASSERT(_rtc_refcount);
if (--_rtc_refcount) {
return 1;

View file

@ -1021,7 +1021,6 @@ static int controller_cmd_handle(uint8_t ocf, struct hci_cmd *cmd, uint8_t *len,
break;
case HCI_OCF_LE_SET_ADV_PARAMS:
ll_adv_params_set(cmd->params.le_set_adv_params.interval_min,
c_adv_type[cmd->params.le_set_adv_params.type],
cmd->params.le_set_adv_params.own_addr_type,
@ -1146,7 +1145,6 @@ static int controller_cmd_handle(uint8_t ocf, struct hci_cmd *cmd, uint8_t *len,
break;
case HCI_OCF_LE_CLEAR_WHITELIST:
radio_filter_clear();
evt->code = HCI_EVT_CODE_COMMAND_COMPLETE;
@ -1156,7 +1154,6 @@ static int controller_cmd_handle(uint8_t ocf, struct hci_cmd *cmd, uint8_t *len,
break;
case HCI_OCF_LE_ADD_DEVICE_TO_WHITELIST:
error_code = radio_filter_add(cmd->params.le_add_dev_to_wlist.
addr_type,
&cmd->params.le_add_dev_to_wlist.addr[0]);
@ -1171,9 +1168,6 @@ static int controller_cmd_handle(uint8_t ocf, struct hci_cmd *cmd, uint8_t *len,
break;
case HCI_OCF_LE_CONNECTION_UPDATE:
/** @todo if peer supports LE Conn Param Req,
* use Req cmd (1) instead of Initiate cmd (0).
*/
status = radio_conn_update(cmd->params.le_conn_update.handle,
0, 0,
cmd->params.le_conn_update.
@ -1310,8 +1304,6 @@ static int controller_cmd_handle(uint8_t ocf, struct hci_cmd *cmd, uint8_t *len,
case HCI_OCF_LE_REMOTE_CONN_PARAM_REQ_NEG_REPLY:
le_cp_req_neg_rep =
&cmd->params.le_remote_conn_param_req_neg_reply;
/** @todo add reject_ext_ind support in ctrl.c */
ASSERT(0);
status = radio_conn_update(le_cp_req_neg_rep->handle, 2,
le_cp_req_neg_rep->reason, 0, 0, 0);
@ -1328,9 +1320,6 @@ static int controller_cmd_handle(uint8_t ocf, struct hci_cmd *cmd, uint8_t *len,
break;
case HCI_OCF_LE_SET_DATA_LENGTH:
/** @todo add reject_ext_ind support in ctrl.c */
ASSERT(0);
status = radio_length_req_send(
cmd->params.le_set_data_length.handle,
cmd->params.le_set_data_length.tx_octets);
@ -1710,7 +1699,7 @@ static void encode_control(uint8_t *buf, uint8_t *len, uint8_t **out)
break;
default:
ASSERT(0);
BT_ASSERT(0);
break;
}
}
@ -1893,7 +1882,7 @@ static void encode_data_ctrl(struct radio_pdu_node_rx *radio_pdu_node_rx,
break;
default:
ASSERT(0);
BT_ASSERT(0);
break;
}
@ -1935,13 +1924,13 @@ static void encode_data(uint8_t *buf, uint8_t *len, uint8_t **out)
if (s_rx_cnt != pdu_data->payload.lldata[0]) {
s_rx_cnt = pdu_data->payload.lldata[0];
ASSERT(0);
BT_ASSERT(0);
} else {
uint8_t index;
for (index = 0; index < pdu_data->len; index++) {
ASSERT(pdu_data->payload.lldata[index] ==
(uint8_t)(s_rx_cnt + index))
BT_ASSERT(pdu_data->payload.lldata[index] ==
(uint8_t)(s_rx_cnt + index));
}
s_rx_cnt++;
@ -1954,7 +1943,7 @@ static void encode_data(uint8_t *buf, uint8_t *len, uint8_t **out)
break;
default:
ASSERT(0);
BT_ASSERT(0);
break;
}

View file

@ -426,7 +426,7 @@ uint32_t radio_init(uint8_t sca, uint8_t connection_count_max,
(void *)&_radio.link_rx_tail);
/* after rx queue allocation, one link mem should still be available */
ASSERT(link);
BT_ASSERT(link);
return retcode;
}
@ -474,7 +474,7 @@ static inline void isr_radio_state_tx(void)
case ROLE_NONE:
default:
ASSERT(0);
BT_ASSERT(0);
break;
}
@ -645,7 +645,7 @@ static inline uint32_t isr_rx_adv(uint8_t devmatch_ok, uint8_t irkmatch_ok,
RADIO_TICKER_USER_ID_WORKER,
RADIO_TICKER_ID_ADV,
ticker_success_assert, (void *)__LINE__);
ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
BT_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
(ticker_status == TICKER_STATUS_BUSY));
/* Stop Direct Adv Stopper */
@ -659,7 +659,7 @@ static inline uint32_t isr_rx_adv(uint8_t devmatch_ok, uint8_t irkmatch_ok,
RADIO_TICKER_ID_ADV_STOP,
0, /* @todo ticker_success_assert */
0 /* @todo (void *) __LINE__*/);
ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
BT_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
(ticker_status == TICKER_STATUS_BUSY));
}
@ -677,7 +677,7 @@ static inline uint32_t isr_rx_adv(uint8_t devmatch_ok, uint8_t irkmatch_ok,
(ticks_slot_offset + conn->hdr.ticks_slot),
event_slave_prepare, conn, ticker_success_assert,
(void *)__LINE__);
ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
BT_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
(ticker_status == TICKER_STATUS_BUSY));
return 0;
@ -794,7 +794,7 @@ static inline uint32_t isr_rx_obs(uint8_t irkmatch_id, uint8_t rssi_ready)
radio_pkt_tx_set(pdu_adv_tx);
ASSERT(!radio_is_ready());
BT_ASSERT(!radio_is_ready());
radio_tmr_end_capture();
@ -857,14 +857,14 @@ static inline uint32_t isr_rx_obs(uint8_t irkmatch_id, uint8_t rssi_ready)
RADIO_TICKER_ID_OBS,
ticker_success_assert,
(void *)__LINE__);
ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
BT_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
(ticker_status == TICKER_STATUS_BUSY));
ticker_status = ticker_stop(RADIO_TICKER_INSTANCE_ID_RADIO,
RADIO_TICKER_USER_ID_WORKER,
RADIO_TICKER_ID_OBS_STOP,
0, /* @todo ticker_success_assert */
0 /* @todo (void *) __LINE__ */);
ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
BT_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
(ticker_status == TICKER_STATUS_BUSY));
ticker_status =
ticker_start(RADIO_TICKER_INSTANCE_ID_RADIO,
@ -879,7 +879,7 @@ static inline uint32_t isr_rx_obs(uint8_t irkmatch_id, uint8_t rssi_ready)
(ticks_slot_offset + conn->hdr.ticks_slot),
event_master_prepare, conn,
ticker_success_assert, (void *)__LINE__);
ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
BT_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
(ticker_status == TICKER_STATUS_BUSY));
return 0;
@ -1107,7 +1107,7 @@ isr_rx_conn_pkt_ctrl_rej(struct radio_pdu_node_rx *radio_pdu_node_rx,
switch (_radio.conn_curr->llcp_type) {
case LLCP_CONNECTION_UPDATE:
ASSERT(_radio.conn_upd == _radio.conn_curr);
BT_ASSERT(_radio.conn_upd == _radio.conn_curr);
/* reset mutex */
_radio.conn_upd = NULL;
@ -1147,7 +1147,7 @@ isr_rx_conn_pkt_ctrl_rej(struct radio_pdu_node_rx *radio_pdu_node_rx,
break;
default:
ASSERT(0);
BT_ASSERT(0);
break;
}
@ -1212,7 +1212,7 @@ static inline void isr_rx_conn_pkt_ctrl_dle(struct pdu_data *pdu_data_rx,
free_count_rx = packet_rx_acquired_count_get()
+ mem_free_count_get(_radio.pkt_rx_data_free);
ASSERT(free_count_rx <= 0xFF);
BT_ASSERT(free_count_rx <= 0xFF);
if (_radio.packet_rx_data_count == free_count_rx) {
@ -1265,7 +1265,7 @@ static inline void isr_rx_conn_pkt_ctrl_dle(struct pdu_data *pdu_data_rx,
*rx_enqueue = 1;
}
} else {
ASSERT(0);
BT_ASSERT(0);
}
if ((PDU_DATA_LLCTRL_TYPE_LENGTH_REQ ==
@ -1352,7 +1352,7 @@ isr_rx_conn_pkt_ctrl(struct radio_pdu_node_rx *radio_pdu_node_rx,
break;
case PDU_DATA_LLCTRL_TYPE_START_ENC_REQ:
ASSERT(_radio.conn_curr->llcp_req ==
BT_ASSERT(_radio.conn_curr->llcp_req ==
_radio.conn_curr->llcp_ack);
/* start enc rsp to be scheduled in master prepare */
@ -1589,7 +1589,7 @@ isr_rx_conn_pkt_ctrl(struct radio_pdu_node_rx *radio_pdu_node_rx,
/* 1. conn update in progress, instant not reached */
/* 2. some other ctrl procedure in progress */
ASSERT(0);
BT_ASSERT(0);
}
break;
@ -1606,7 +1606,7 @@ isr_rx_conn_pkt_ctrl(struct radio_pdu_node_rx *radio_pdu_node_rx,
/* By spec. slave shall not generate a conn update
* complete on reject from master.
*/
ASSERT(_radio.conn_curr->role.slave.role != 0);
BT_ASSERT(_radio.conn_curr->role.slave.role);
}
break;
@ -1626,7 +1626,7 @@ isr_rx_conn_pkt_ctrl(struct radio_pdu_node_rx *radio_pdu_node_rx,
switch (_radio.conn_curr->llcp_type) {
default:
ASSERT(0);
BT_ASSERT(0);
break;
}
} else if (_radio.conn_curr->llcp_length.req !=
@ -1754,7 +1754,7 @@ isr_rx_conn_pkt(struct radio_pdu_node_rx *radio_pdu_node_rx,
uint32_t done;
done = radio_ccm_is_done();
ASSERT(done);
BT_ASSERT(done);
_radio.conn_curr->ccm_rx.counter++;
}
@ -1793,7 +1793,7 @@ isr_rx_conn_pkt(struct radio_pdu_node_rx *radio_pdu_node_rx,
break;
case PDU_DATA_LLID_RESV:
default:
ASSERT(0);
BT_ASSERT(0);
break;
}
@ -1994,7 +1994,7 @@ static inline void isr_radio_state_rx(uint8_t trx_done, uint8_t crc_ok,
case ROLE_NONE:
default:
ASSERT(0);
BT_ASSERT(0);
break;
}
}
@ -2038,7 +2038,7 @@ static inline uint32_t isr_close_adv(void)
0, 0, 0, 0, 0,
ticker_success_assert,
(void *)__LINE__);
ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
BT_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
(ticker_status == TICKER_STATUS_BUSY));
}
}
@ -2079,7 +2079,7 @@ static inline uint32_t isr_close_obs(void)
RADIO_TICKER_ID_OBS_STOP,
0 /** @todo ticker_success_assert */,
0 /** @todo (void *) __LINE__ */);
ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
BT_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
(ticker_status == TICKER_STATUS_BUSY));
}
}
@ -2281,7 +2281,8 @@ static inline void isr_close_conn(void)
/* Prepare the rx packet structure */
radio_pdu_node_rx = packet_rx_reserve_get(2);
ASSERT(radio_pdu_node_rx);
BT_ASSERT(radio_pdu_node_rx);
radio_pdu_node_rx->hdr.handle = _radio.conn_curr->handle;
radio_pdu_node_rx->hdr.type = NODE_RX_TYPE_APTO;
@ -2360,7 +2361,7 @@ static inline void isr_close_conn(void)
lazy, force,
0 /** @todo ticker_success_assert */,
0 /** @todo (void *) __LINE__ */);
ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
BT_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
(ticker_status == TICKER_STATUS_BUSY));
}
}
@ -2385,7 +2386,7 @@ static inline void isr_radio_state_close(void)
case ROLE_NONE:
default:
ASSERT(0);
BT_ASSERT(0);
break;
}
@ -2462,11 +2463,11 @@ static void isr(void)
break;
default:
ASSERT(0);
BT_ASSERT(0);
break;
}
ASSERT(((_radio.state != STATE_RX) && (_radio.state != STATE_TX)) ||
BT_ASSERT(((_radio.state != STATE_RX) && (_radio.state != STATE_TX)) ||
(!radio_is_ready()));
DEBUG_RADIO_ISR(0);
@ -2493,7 +2494,7 @@ static void ticker_success_assert(uint32_t status, void *params)
{
ARG_UNUSED(params);
ASSERT(status == TICKER_STATUS_SUCCESS);
BT_ASSERT(status == TICKER_STATUS_SUCCESS);
}
static void work_radio_active(void *params)
@ -2509,7 +2510,7 @@ static void work_radio_active(void *params)
radio_active_callback(1);
} else {
ASSERT(s_active);
BT_ASSERT(s_active);
if (--s_active) {
return;
@ -2535,7 +2536,7 @@ static void event_active(uint32_t ticks_at_expire, uint32_t remainder,
ARG_UNUSED(context);
retval = work_schedule(&s_work_radio_active, 0);
ASSERT(!retval);
BT_ASSERT(!retval);
}
static void work_radio_inactive(void *params)
@ -2560,7 +2561,7 @@ static void event_inactive(uint32_t ticks_at_expire, uint32_t remainder,
ARG_UNUSED(context);
retval = work_schedule(&s_work_radio_inactive, 0);
ASSERT(!retval);
BT_ASSERT(!retval);
}
static void work_xtal_start(void *params)
@ -2583,7 +2584,7 @@ static void event_xtal(uint32_t ticks_at_expire, uint32_t remainder,
ARG_UNUSED(context);
retval = work_schedule(&s_work_xtal_start, 0);
ASSERT(!retval);
BT_ASSERT(!retval);
}
static void work_xtal_stop(void *params)
@ -2610,7 +2611,7 @@ static void work_xtal_retain(uint8_t retain)
s_xtal_retained = 1;
retval = work_schedule(&s_work_xtal_start, 0);
ASSERT(!retval);
BT_ASSERT(!retval);
}
} else {
if (s_xtal_retained) {
@ -2622,7 +2623,7 @@ static void work_xtal_retain(uint8_t retain)
s_xtal_retained = 0;
retval = work_schedule(&s_work_xtal_stop, 0);
ASSERT(!retval);
BT_ASSERT(!retval);
}
}
}
@ -2673,8 +2674,8 @@ static void prepare_normal_set(struct shdr *hdr,
ticker_id, 0, ticks_drift_minus,
ticks_drift_minus, 0, 0, 0,
prepare_normal, hdr);
ASSERT((ticker_status == TICKER_STATUS_SUCCESS)
|| (ticker_status == TICKER_STATUS_BUSY));
BT_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
(ticker_status == TICKER_STATUS_BUSY));
}
}
@ -2731,7 +2732,7 @@ static void work_xtal_stop_calc(void *params)
ticker_job_sched(RADIO_TICKER_INSTANCE_ID_RADIO);
}
ASSERT(ticker_status == TICKER_STATUS_SUCCESS);
BT_ASSERT(ticker_status == TICKER_STATUS_SUCCESS);
if ((ticker_id != 0xff) &&
(ticks_to_expire < TICKER_US_TO_TICKS(10000))) {
@ -2756,7 +2757,7 @@ static void work_xtal_stop_calc(void *params)
} else if (ticker_id == RADIO_TICKER_ID_OBS) {
hdr = &_radio.observer.hdr;
} else {
ASSERT(0);
BT_ASSERT(0);
}
/* compensate for reduced next ticker's prepare or
@ -2791,7 +2792,7 @@ static void work_xtal_stop_calc(void *params)
0, 0,
prepare_reduced,
hdr);
ASSERT((TICKER_STATUS_SUCCESS ==
BT_ASSERT((TICKER_STATUS_SUCCESS ==
ticker_status) ||
(TICKER_STATUS_BUSY ==
ticker_status));
@ -2890,7 +2891,7 @@ static void work_xtal_stop_calc(void *params)
} else if (ticker_id == RADIO_TICKER_ID_OBS) {
hdr = &_radio.observer.hdr;
} else {
ASSERT(0);
BT_ASSERT(0);
}
/* Use normal prepare */
@ -2930,7 +2931,7 @@ static void sched_after_master_free_slot_get(uint8_t user_id,
ticker_job_sched(RADIO_TICKER_INSTANCE_ID_RADIO);
}
ASSERT(ticker_status == TICKER_STATUS_SUCCESS);
BT_ASSERT(ticker_status == TICKER_STATUS_SUCCESS);
if (ticker_id == 0xff) {
break;
@ -3082,7 +3083,7 @@ static void sched_free_win_offset_calc(struct connection *conn_curr,
ticker_job_sched(RADIO_TICKER_INSTANCE_ID_RADIO);
}
ASSERT(ticker_status == TICKER_STATUS_SUCCESS);
BT_ASSERT(ticker_status == TICKER_STATUS_SUCCESS);
if (ticker_id == 0xff) {
break;
@ -3090,7 +3091,7 @@ static void sched_free_win_offset_calc(struct connection *conn_curr,
if ((ticker_id_prev != 0xff) &&
(ticks_anchor != ticks_anchor_prev)) {
ASSERT(0);
BT_ASSERT(0);
}
if (ticker_id < RADIO_TICKER_ID_ADV) {
@ -3307,7 +3308,7 @@ static void work_radio_stop(void *params)
enum state state = (enum state)((uint32_t)params & 0xff);
uint32_t radio_used;
ASSERT((state == STATE_STOP) || (state == STATE_ABORT));
BT_ASSERT((state == STATE_STOP) || (state == STATE_ABORT));
radio_used = ((_radio.state != STATE_NONE) &&
(_radio.state != STATE_STOP) &&
@ -3340,7 +3341,7 @@ static void event_stop(uint32_t ticks_at_expire, uint32_t remainder,
/* Stop Radio Tx/Rx */
retval = work_schedule(&s_work_radio_stop, 0);
ASSERT(!retval);
BT_ASSERT(!retval);
}
static void event_common_prepare(uint32_t ticks_at_expire,
@ -3386,7 +3387,7 @@ static void event_common_prepare(uint32_t ticks_at_expire,
TICKER_NULL_REMAINDER, TICKER_NULL_LAZY,
TICKER_NULL_SLOT, event_active, 0,
ticker_success_assert, (void *)__LINE__);
ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
BT_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
(ticker_status == TICKER_STATUS_BUSY));
event_xtal(0, 0, 0, 0);
@ -3407,7 +3408,7 @@ static void event_common_prepare(uint32_t ticks_at_expire,
TICKER_NULL_REMAINDER, TICKER_NULL_LAZY,
TICKER_NULL_SLOT, event_xtal, 0,
ticker_success_assert, (void *)__LINE__);
ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
BT_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
(ticker_status == TICKER_STATUS_BUSY));
} else {
/* Active and XTAL are at the same time,
@ -3431,7 +3432,7 @@ static void event_common_prepare(uint32_t ticks_at_expire,
TICKER_NULL_LAZY, TICKER_NULL_SLOT,
ticker_timeout_fp, context, ticker_success_assert,
(void *)__LINE__);
ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
BT_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
(ticker_status == TICKER_STATUS_BUSY));
#define RADIO_DEFERRED_PREEMPT 0
@ -3447,7 +3448,7 @@ static void event_common_prepare(uint32_t ticks_at_expire,
TICKER_NULL_LAZY, TICKER_NULL_SLOT,
event_stop, (void *)STATE_ABORT,
ticker_success_assert, (void *)__LINE__);
ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
BT_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
(ticker_status == TICKER_STATUS_BUSY));
}
#else
@ -3476,7 +3477,7 @@ static void event_common_prepare(uint32_t ticks_at_expire,
ticks_to_start, ticks_to_start_new,
ticks_to_start_new, ticks_to_start, 0, 0,
ticker_success_assert, (void *)__LINE__);
ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
BT_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
(ticker_status == TICKER_STATUS_BUSY));
}
@ -3494,7 +3495,7 @@ static void event_common_prepare(uint32_t ticks_at_expire,
s_work_xtal_stop_calc.params = (void *)(uint32_t)ticker_id;
retval = work_schedule(&s_work_xtal_stop_calc, 1);
ASSERT(!retval);
BT_ASSERT(!retval);
}
#endif
}
@ -3567,7 +3568,7 @@ static void channel_set(uint32_t channel)
} else if (channel < 40) {
radio_freq_chnl_set(28 + (2 * (channel - 11)));
} else {
ASSERT(0);
BT_ASSERT(0);
}
break;
}
@ -3733,8 +3734,8 @@ static void event_adv(uint32_t ticks_at_expire, uint32_t remainder,
DEBUG_RADIO_START_A(1);
ASSERT(_radio.role == ROLE_NONE);
ASSERT(_radio.ticker_id_prepare == RADIO_TICKER_ID_ADV);
BT_ASSERT(_radio.role == ROLE_NONE);
BT_ASSERT(_radio.ticker_id_prepare == RADIO_TICKER_ID_ADV);
/** @todo check if XTAL is started,
* options 1: abort Radio Start,
@ -3783,7 +3784,7 @@ static void event_adv(uint32_t ticks_at_expire, uint32_t remainder,
ticker_job_idle_get(RADIO_TICKER_INSTANCE_ID_RADIO,
RADIO_TICKER_USER_ID_WORKER,
ticker_job_disable, 0);
ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
BT_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
(ticker_status == TICKER_STATUS_BUSY));
}
#endif
@ -3809,7 +3810,7 @@ void event_adv_stop(uint32_t ticks_at_expire, uint32_t remainder,
ticker_stop(RADIO_TICKER_INSTANCE_ID_RADIO,
RADIO_TICKER_USER_ID_WORKER, RADIO_TICKER_ID_ADV,
ticker_success_assert, (void *)__LINE__);
ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
BT_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
(ticker_status == TICKER_STATUS_BUSY));
/** @todo synchronize stopping of scanner, i.e. pre-event and event
* needs to complete
@ -3819,17 +3820,17 @@ void event_adv_stop(uint32_t ticks_at_expire, uint32_t remainder,
RADIO_TICKER_USER_ID_WORKER,
RADIO_TICKER_ID_MARKER_0,
ticker_success_assert, (void *)__LINE__);
ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
BT_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
(ticker_status == TICKER_STATUS_BUSY));
ticker_status = ticker_stop(RADIO_TICKER_INSTANCE_ID_RADIO,
RADIO_TICKER_USER_ID_WORKER, RADIO_TICKER_ID_EVENT,
ticker_success_assert, (void *)__LINE__);
ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
BT_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
(ticker_status == TICKER_STATUS_BUSY));
/* Prepare the rx packet structure */
radio_pdu_node_rx = packet_rx_reserve_get(1);
ASSERT(radio_pdu_node_rx);
BT_ASSERT(radio_pdu_node_rx);
/** Connection handle */
radio_pdu_node_rx->hdr.handle = 0xffff;
@ -3892,7 +3893,7 @@ static void event_obs_prepare(uint32_t ticks_at_expire, uint32_t remainder,
retval = work_schedule(&_work_sched_after_master_free_offset_get,
1);
ASSERT(!retval);
BT_ASSERT(!retval);
}
#endif
@ -3910,8 +3911,8 @@ static void event_obs(uint32_t ticks_at_expire, uint32_t remainder,
DEBUG_RADIO_START_O(1);
ASSERT(_radio.role == ROLE_NONE);
ASSERT(_radio.ticker_id_prepare == RADIO_TICKER_ID_OBS);
BT_ASSERT(_radio.role == ROLE_NONE);
BT_ASSERT(_radio.ticker_id_prepare == RADIO_TICKER_ID_OBS);
/** @todo check if XTAL is started, options 1: abort Radio Start,
* 2: wait for XTAL start
@ -3973,7 +3974,7 @@ static void event_obs(uint32_t ticks_at_expire, uint32_t remainder,
event_stop, (void *)STATE_STOP,
ticker_success_assert, (void *)__LINE__);
ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
BT_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
(ticker_status == TICKER_STATUS_BUSY));
/* Ticker Job Silence */
@ -3986,7 +3987,7 @@ static void event_obs(uint32_t ticks_at_expire, uint32_t remainder,
RADIO_TICKER_USER_ID_WORKER,
ticker_job_disable, 0);
ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
BT_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
(ticker_status == TICKER_STATUS_BUSY));
}
#endif
@ -4056,7 +4057,7 @@ static inline void event_conn_update_st_init(struct connection *conn,
work_sched_offset->params = (void *)conn;
retval = work_schedule(work_sched_offset, 1);
ASSERT(!retval);
BT_ASSERT(!retval);
}
#endif
}
@ -4121,7 +4122,7 @@ static inline void event_conn_update_st_req(struct connection *conn,
work_sched_offset->params = (void *)conn;
retval = work_schedule(work_sched_offset, 1);
ASSERT(!retval);
BT_ASSERT(!retval);
}
#endif
}
@ -4245,7 +4246,7 @@ static inline uint32_t event_conn_update_prep(struct connection *conn,
break;
default:
ASSERT(0);
BT_ASSERT(0);
break;
}
@ -4285,7 +4286,8 @@ static inline uint32_t event_conn_update_prep(struct connection *conn,
(conn->llcp.connection_update.timeout !=
(conn->conn_interval * conn->supervision_reload * 125 / 1000))) {
radio_pdu_node_rx = packet_rx_reserve_get(2);
ASSERT(radio_pdu_node_rx);
BT_ASSERT(radio_pdu_node_rx);
radio_pdu_node_rx->hdr.handle = conn->handle;
radio_pdu_node_rx->hdr.type = NODE_RX_TYPE_CONN_UPDATE;
@ -4417,7 +4419,7 @@ static inline uint32_t event_conn_update_prep(struct connection *conn,
RADIO_TICKER_ID_FIRST_CONNECTION +
conn->handle, ticker_success_assert,
(void *)__LINE__);
ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
BT_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
(ticker_status == TICKER_STATUS_BUSY));
ticker_status =
ticker_start(RADIO_TICKER_INSTANCE_ID_RADIO,
@ -4433,7 +4435,7 @@ static inline uint32_t event_conn_update_prep(struct connection *conn,
event_slave_prepare : event_master_prepare,
conn, ticker_success_assert,
(void *)__LINE__);
ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
BT_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
(ticker_status == TICKER_STATUS_BUSY));
/* enable ticker job, if disabled in this function */
@ -4694,7 +4696,8 @@ static inline void event_vex_prep(struct connection *conn)
/* Prepare the rx packet structure */
radio_pdu_node_rx = packet_rx_reserve_get(2);
ASSERT(radio_pdu_node_rx);
BT_ASSERT(radio_pdu_node_rx);
radio_pdu_node_rx->hdr.handle = conn->handle;
radio_pdu_node_rx->hdr.type = NODE_RX_TYPE_DC_PDU;
@ -4716,7 +4719,7 @@ static inline void event_vex_prep(struct connection *conn)
packet_rx_enqueue();
} else {
/* tx-ed but no rx, and new request placed */
ASSERT(0);
BT_ASSERT(0);
}
}
@ -4761,7 +4764,7 @@ static inline void event_len_prep(struct connection *conn)
free_count_rx = packet_rx_acquired_count_get() +
mem_free_count_get(_radio.pkt_rx_data_free);
ASSERT(free_count_rx <= 0xFF);
BT_ASSERT(free_count_rx <= 0xFF);
if (_radio.packet_rx_data_count != free_count_rx) {
break;
@ -4811,10 +4814,10 @@ static inline void event_len_prep(struct connection *conn)
free_count_rx = packet_rx_acquired_count_get() +
mem_free_count_get(_radio.pkt_rx_data_free);
ASSERT(free_count_rx <= 0xFF);
BT_ASSERT(free_count_rx <= 0xFF);
if (_radio.packet_rx_data_count != free_count_rx) {
ASSERT(0);
BT_ASSERT(0);
}
/* Procedure complete */
@ -4853,7 +4856,7 @@ static inline void event_len_prep(struct connection *conn)
mem_release(node_rx->hdr.onion.link,
&_radio.link_rx_free);
ASSERT(_radio.link_rx_data_quota <
BT_ASSERT(_radio.link_rx_data_quota <
(_radio.packet_rx_count - 1));
_radio.link_rx_data_quota++;
@ -4878,7 +4881,7 @@ static inline void event_len_prep(struct connection *conn)
_radio.packet_rx_data_count =
_radio.packet_rx_data_pool_size /
_radio.packet_rx_data_size;
ASSERT(_radio.packet_rx_data_count);
BT_ASSERT(_radio.packet_rx_data_count);
/* re-size (re-init) the free rx pool */
mem_init(_radio.pkt_rx_data_pool,
@ -4894,7 +4897,7 @@ static inline void event_len_prep(struct connection *conn)
/* Prepare the rx packet structure */
node_rx = packet_rx_reserve_get(2);
ASSERT(node_rx);
BT_ASSERT(node_rx);
node_rx->hdr.handle = conn->handle;
node_rx->hdr.type = NODE_RX_TYPE_DC_PDU;
@ -4925,7 +4928,7 @@ static inline void event_len_prep(struct connection *conn)
break;
default:
ASSERT(0);
BT_ASSERT(0);
break;
}
}
@ -4992,7 +4995,7 @@ static void event_connection_prepare(uint32_t ticks_at_expire,
break;
default:
ASSERT(0);
BT_ASSERT(0);
break;
}
}
@ -5092,10 +5095,10 @@ static void event_slave(uint32_t ticks_at_expire, uint32_t remainder,
DEBUG_RADIO_START_S(1);
ASSERT(_radio.role == ROLE_NONE);
BT_ASSERT(_radio.role == ROLE_NONE);
conn = (struct connection *)context;
ASSERT(_radio.ticker_id_prepare ==
BT_ASSERT(_radio.ticker_id_prepare ==
(RADIO_TICKER_ID_FIRST_CONNECTION + conn->handle));
_radio.role = ROLE_SLAVE;
@ -5174,7 +5177,7 @@ static void event_slave(uint32_t ticks_at_expire, uint32_t remainder,
ticker_job_idle_get(RADIO_TICKER_INSTANCE_ID_RADIO,
RADIO_TICKER_USER_ID_WORKER,
ticker_job_disable, 0);
ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
BT_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
(ticker_status == TICKER_STATUS_BUSY));
}
#endif
@ -5207,10 +5210,10 @@ static void event_master(uint32_t ticks_at_expire, uint32_t remainder,
DEBUG_RADIO_START_M(1);
ASSERT(_radio.role == ROLE_NONE);
BT_ASSERT(_radio.role == ROLE_NONE);
conn = (struct connection *)context;
ASSERT(_radio.ticker_id_prepare ==
BT_ASSERT(_radio.ticker_id_prepare ==
(RADIO_TICKER_ID_FIRST_CONNECTION + conn->handle));
_radio.role = ROLE_MASTER;
@ -5311,7 +5314,7 @@ static void event_master(uint32_t ticks_at_expire, uint32_t remainder,
ticker_job_idle_get(RADIO_TICKER_INSTANCE_ID_RADIO,
RADIO_TICKER_USER_ID_WORKER,
ticker_job_disable, 0);
ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
BT_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
(ticker_status == TICKER_STATUS_BUSY));
}
#endif
@ -5515,7 +5518,7 @@ static void packet_rx_enqueue(void)
struct radio_pdu_node_rx *radio_pdu_node_rx;
uint8_t last;
ASSERT(_radio.packet_rx_last != _radio.packet_rx_acquire);
BT_ASSERT(_radio.packet_rx_last != _radio.packet_rx_acquire);
/* Remember the rx node and acquired link mem */
radio_pdu_node_rx = _radio.packet_rx[_radio.packet_rx_last];
@ -5537,7 +5540,7 @@ static void packet_rx_enqueue(void)
/* Enqueue into event-cum-data queue */
link = memq_enqueue(radio_pdu_node_rx, link,
(void *)&_radio.link_rx_tail);
ASSERT(link);
BT_ASSERT(link);
/* callback to trigger application action */
radio_event_callback();
@ -5645,7 +5648,7 @@ static void ctrl_tx_enqueue(struct connection *conn,
conn->pkt_tx_ctrl = node_tx;
} else {
/* More than 2 pending ctrl not supported */
ASSERT(conn->pkt_tx_ctrl->next == conn->pkt_tx_data);
BT_ASSERT(conn->pkt_tx_ctrl->next == conn->pkt_tx_data);
node_tx->next = conn->pkt_tx_ctrl->next;
conn->pkt_tx_ctrl->next = node_tx;
@ -5680,7 +5683,7 @@ static void pdu_node_tx_release(uint16_t handle,
last = 0;
}
ASSERT(last != _radio.packet_release_first);
BT_ASSERT(last != _radio.packet_release_first);
/* Enqueue app mem for release */
_radio.pkt_release[_radio.packet_release_last].handle = handle;
@ -5709,7 +5712,7 @@ static void connection_release(struct connection *conn)
RADIO_TICKER_USER_ID_WORKER,
(RADIO_TICKER_ID_FIRST_CONNECTION + conn->handle),
ticker_success_assert, (void *)__LINE__);
ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
BT_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
(ticker_status == TICKER_STATUS_BUSY));
/* Stop Marker 0 and event single-shot tickers */
@ -5721,14 +5724,14 @@ static void connection_release(struct connection *conn)
RADIO_TICKER_USER_ID_WORKER,
RADIO_TICKER_ID_MARKER_0,
ticker_success_assert, (void *)__LINE__);
ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
BT_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
(ticker_status == TICKER_STATUS_BUSY));
ticker_status =
ticker_stop(RADIO_TICKER_INSTANCE_ID_RADIO,
RADIO_TICKER_USER_ID_WORKER,
RADIO_TICKER_ID_EVENT,
ticker_success_assert, (void *)__LINE__);
ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
BT_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
(ticker_status == TICKER_STATUS_BUSY));
}
@ -5797,7 +5800,8 @@ static void terminate_ind_rx_enqueue(struct connection *conn, uint8_t reason)
/* Prepare the rx packet structure */
radio_pdu_node_rx =
(struct radio_pdu_node_rx *)&conn->llcp_terminate.radio_pdu_node_rx;
ASSERT(radio_pdu_node_rx->hdr.onion.link);
BT_ASSERT(radio_pdu_node_rx->hdr.onion.link);
radio_pdu_node_rx->hdr.handle = conn->handle;
radio_pdu_node_rx->hdr.type = NODE_RX_TYPE_TERMINATE;
*((uint8_t *)radio_pdu_node_rx->pdu_data) = reason;
@ -5814,7 +5818,7 @@ static void terminate_ind_rx_enqueue(struct connection *conn, uint8_t reason)
/* Enqueue into event-cum-data queue */
link = memq_enqueue(radio_pdu_node_rx, link,
(void *)&_radio.link_rx_tail);
ASSERT(link);
BT_ASSERT(link);
/* callback to trigger application action */
radio_event_callback();
@ -5828,7 +5832,7 @@ static uint32_t conn_update(struct connection *conn,
return 1;
}
ASSERT((conn->llcp_req == conn->llcp_ack) ||
BT_ASSERT((conn->llcp_req == conn->llcp_ack) ||
((conn->llcp_type == LLCP_CONNECTION_UPDATE) &&
(conn->llcp.connection_update.state ==
LLCP_CONN_STATE_RSP_WAIT)));
@ -5837,7 +5841,7 @@ static uint32_t conn_update(struct connection *conn,
* be set, but a slave we accept it as new 'set' of mutex.
*/
if (_radio.conn_upd == 0) {
ASSERT(conn->role.slave.role != 0);
BT_ASSERT(conn->role.slave.role != 0);
_radio.conn_upd = conn;
}
@ -5909,7 +5913,7 @@ static uint32_t channel_map_update(struct connection *conn,
return 1;
}
ASSERT(conn->llcp_req == conn->llcp_ack);
BT_ASSERT(conn->llcp_req == conn->llcp_ack);
memcpy(&conn->llcp.channel_map.chm[0],
&pdu_data_rx->payload.llctrl.ctrldata.channel_map_req.chm[0],
@ -5956,7 +5960,7 @@ static void enc_rsp_send(struct connection *conn)
/* acquire tx mem */
node_tx = mem_acquire(&_radio.pkt_tx_ctrl_free);
ASSERT(node_tx);
BT_ASSERT(node_tx);
pdu_ctrl_tx = (struct pdu_data *)node_tx->pdu_data;
pdu_ctrl_tx->ll_id = PDU_DATA_LLID_CTRL;
@ -5987,7 +5991,7 @@ static void start_enc_rsp_send(struct connection *conn,
if (!pdu_ctrl_tx) {
/* acquire tx mem */
node_tx = mem_acquire(&_radio.pkt_tx_ctrl_free);
ASSERT(node_tx);
BT_ASSERT(node_tx);
pdu_ctrl_tx = (struct pdu_data *)node_tx->pdu_data;
}
@ -6009,7 +6013,7 @@ static void unknown_rsp_send(struct connection *conn, uint8_t type)
/* acquire tx mem */
node_tx = mem_acquire(&_radio.pkt_tx_ctrl_free);
ASSERT(node_tx);
BT_ASSERT(node_tx);
pdu_ctrl_tx = (struct pdu_data *)node_tx->pdu_data;
pdu_ctrl_tx->ll_id = PDU_DATA_LLID_CTRL;
@ -6028,7 +6032,7 @@ static void feature_rsp_send(struct connection *conn)
/* acquire tx mem */
node_tx = mem_acquire(&_radio.pkt_tx_ctrl_free);
ASSERT(node_tx);
BT_ASSERT(node_tx);
pdu_ctrl_tx = (struct pdu_data *)node_tx->pdu_data;
pdu_ctrl_tx->ll_id = PDU_DATA_LLID_CTRL;
@ -6051,7 +6055,7 @@ static void pause_enc_rsp_send(struct connection *conn)
/* acquire tx mem */
node_tx = mem_acquire(&_radio.pkt_tx_ctrl_free);
ASSERT(node_tx);
BT_ASSERT(node_tx);
pdu_ctrl_tx = (struct pdu_data *)node_tx->pdu_data;
pdu_ctrl_tx->ll_id = PDU_DATA_LLID_CTRL;
@ -6069,7 +6073,7 @@ static void version_ind_send(struct connection *conn)
/* acquire tx mem */
node_tx = mem_acquire(&_radio.pkt_tx_ctrl_free);
ASSERT(node_tx);
BT_ASSERT(node_tx);
pdu_ctrl_tx = (struct pdu_data *)node_tx->pdu_data;
pdu_ctrl_tx->ll_id = PDU_DATA_LLID_CTRL;
@ -6096,7 +6100,7 @@ static void ping_resp_send(struct connection *conn)
/* acquire tx mem */
node_tx = mem_acquire(&_radio.pkt_tx_ctrl_free);
ASSERT(node_tx);
BT_ASSERT(node_tx);
pdu_ctrl_tx = (struct pdu_data *)node_tx->pdu_data;
pdu_ctrl_tx->ll_id = PDU_DATA_LLID_CTRL;
@ -6114,7 +6118,7 @@ static void reject_ind_ext_send(struct connection *conn,
/* acquire tx mem */
node_tx = mem_acquire(&_radio.pkt_tx_ctrl_free);
ASSERT(node_tx);
BT_ASSERT(node_tx);
pdu_ctrl_tx = (struct pdu_data *)node_tx->pdu_data;
pdu_ctrl_tx->ll_id = PDU_DATA_LLID_CTRL;
@ -6137,7 +6141,7 @@ static void length_resp_send(struct connection *conn, uint16_t eff_rx_octets,
struct pdu_data *pdu_ctrl_tx;
node_tx = mem_acquire(&_radio.pkt_tx_ctrl_free);
ASSERT(node_tx);
BT_ASSERT(node_tx);
pdu_ctrl_tx = (struct pdu_data *) node_tx->pdu_data;
pdu_ctrl_tx->ll_id = PDU_DATA_LLID_CTRL;
@ -6232,7 +6236,7 @@ static inline void do_adv_scan_disable(uint8_t ticker_id_stop,
if (ticker_status_event == TICKER_STATUS_BUSY) {
work_enable(WORK_TICKER_JOB0_IRQ);
ASSERT(ticker_status_event != TICKER_STATUS_BUSY);
BT_ASSERT(ticker_status_event != TICKER_STATUS_BUSY);
}
if (ticker_status_event == TICKER_STATUS_SUCCESS) {
@ -6253,7 +6257,7 @@ static inline void do_adv_scan_disable(uint8_t ticker_id_stop,
if (ticker_status_pre_event == TICKER_STATUS_BUSY) {
work_enable(WORK_TICKER_JOB0_IRQ);
ASSERT(ticker_status_event != TICKER_STATUS_BUSY);
BT_ASSERT(ticker_status_event != TICKER_STATUS_BUSY);
}
if (ticker_status_pre_event == TICKER_STATUS_SUCCESS) {
@ -6268,13 +6272,13 @@ static inline void do_adv_scan_disable(uint8_t ticker_id_stop,
*/
retval = work_schedule(&s_work_radio_inactive,
0);
ASSERT(!retval);
BT_ASSERT(!retval);
} else {
uint32_t retval;
/* XTAL started, handle XTAL stop here */
retval = work_schedule(&s_work_xtal_stop, 0);
ASSERT(!retval);
BT_ASSERT(!retval);
}
} else if (ticker_status_pre_event == TICKER_STATUS_FAILURE) {
uint32_t retval;
@ -6283,13 +6287,13 @@ static inline void do_adv_scan_disable(uint8_t ticker_id_stop,
/* radio active asserted, handle deasserting here */
retval = work_schedule(&s_work_radio_inactive, 0);
ASSERT(!retval);
BT_ASSERT(!retval);
/* XTAL started, handle XTAL stop here */
retval = work_schedule(&s_work_xtal_stop, 0);
ASSERT(!retval);
BT_ASSERT(!retval);
} else {
ASSERT(0);
BT_ASSERT(0);
}
} else if (ticker_status_event == TICKER_STATUS_FAILURE) {
uint32_t volatile ticker_status_stop;
@ -6309,10 +6313,10 @@ static inline void do_adv_scan_disable(uint8_t ticker_id_stop,
if (ticker_status_stop == TICKER_STATUS_BUSY) {
work_enable(WORK_TICKER_JOB0_IRQ);
ASSERT(ticker_status_event != TICKER_STATUS_BUSY);
BT_ASSERT(ticker_status_event != TICKER_STATUS_BUSY);
}
ASSERT((ticker_status_stop == TICKER_STATUS_SUCCESS) ||
BT_ASSERT((ticker_status_stop == TICKER_STATUS_SUCCESS) ||
(ticker_status_stop == TICKER_STATUS_FAILURE));
if (_radio.role != ROLE_NONE) {
@ -6326,7 +6330,7 @@ static inline void do_adv_scan_disable(uint8_t ticker_id_stop,
/* Stop Radio Tx/Rx */
retval = work_schedule(&s_work_radio_stop, 0);
ASSERT(!retval);
BT_ASSERT(!retval);
/* wait for radio ISR to exit */
while (_radio.role != ROLE_NONE) {
@ -6334,7 +6338,7 @@ static inline void do_adv_scan_disable(uint8_t ticker_id_stop,
}
}
} else {
ASSERT(0);
BT_ASSERT(0);
}
}
@ -7199,7 +7203,7 @@ void radio_rx_dequeue(void)
link = memq_dequeue(_radio.link_rx_tail, &_radio.link_rx_head,
(void **)&radio_pdu_node_rx);
ASSERT(link);
BT_ASSERT(link);
mem_release(link, &_radio.link_rx_free);
@ -7213,7 +7217,7 @@ void radio_rx_dequeue(void)
case NODE_RX_TYPE_APTO:
case NODE_RX_TYPE_RSSI:
/* release data link credit quota */
ASSERT(_radio.link_rx_data_quota <
BT_ASSERT(_radio.link_rx_data_quota <
(_radio.packet_rx_count - 1));
_radio.link_rx_data_quota++;
@ -7224,7 +7228,7 @@ void radio_rx_dequeue(void)
break;
default:
ASSERT(0);
BT_ASSERT(0);
break;
}
}
@ -7262,7 +7266,7 @@ void radio_rx_mem_release(struct radio_pdu_node_rx **radio_pdu_node_rx)
break;
default:
ASSERT(0);
BT_ASSERT(0);
break;
}
}
@ -7357,7 +7361,7 @@ static void ticker_op_latency_cancelled(uint32_t ticker_status,
{
struct connection *conn;
ASSERT(ticker_status == TICKER_STATUS_SUCCESS);
BT_ASSERT(ticker_status == TICKER_STATUS_SUCCESS);
conn = (struct connection *)params;
conn->role.slave.latency_cancel = 0;
@ -7399,7 +7403,7 @@ uint32_t radio_tx_mem_enqueue(uint16_t handle,
conn->handle, 0, 0, 0, 0, 1, 0,
ticker_op_latency_cancelled,
(void *)conn);
ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
BT_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
(ticker_status == TICKER_STATUS_BUSY));
}

View file

@ -1053,7 +1053,8 @@ static inline void ticker_job_compare_update(
do {
uint32_t ticks_elapsed;
ASSERT(i--);
BT_ASSERT(i);
i--;
ctr = rtc_tick_get();
cc = instance->ticks_current;

View file

@ -225,10 +225,10 @@ static void native_recv_fiber(int unused0, int unused1)
int retval;
hci_encode_num_cmplt(handle, num_cmplt, &len, &buf);
ASSERT(len);
BT_ASSERT(len);
retval = native_recv(len, buf);
ASSERT(!retval);
BT_ASSERT(!retval);
fiber_yield();
}
@ -245,7 +245,7 @@ static void native_recv_fiber(int unused0, int unused1)
*/
if (len) {
retval = native_recv(len, buf);
ASSERT(!retval);
BT_ASSERT(!retval);
}
radio_rx_dequeue();