summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
22661ba)
The cc1120 receive code is 'twisty', in that it acquires the SPI mutex
in the middle of an interrupt handler so that it can quickly start the
radio when the signal comes in. This means we have to be careful to
drop that mutex in all paths which leave the receive code, including
when the packet receive is aborted mid-way through the process.
Signed-off-by: Keith Packard <keithp@keithp.com>
ao_exti_set_mode(AO_CC1120_INT_PORT, AO_CC1120_INT_PIN,
AO_EXTI_MODE_FALLING|AO_EXTI_PRIORITY_HIGH);
ao_exti_set_mode(AO_CC1120_INT_PORT, AO_CC1120_INT_PIN,
AO_EXTI_MODE_FALLING|AO_EXTI_PRIORITY_HIGH);
- ao_exti_set_callback(AO_CC1120_INT_PORT, AO_CC1120_INT_PIN, ao_radio_rx_isr);
- ao_exti_enable(AO_CC1120_INT_PORT, AO_CC1120_INT_PIN);
-
rx_starting = 1;
rx_task_id = ao_cur_task->task_id;
rx_starting = 1;
rx_task_id = ao_cur_task->task_id;
+ ao_exti_set_callback(AO_CC1120_INT_PORT, AO_CC1120_INT_PIN, ao_radio_rx_isr);
+ ao_exti_enable(AO_CC1120_INT_PORT, AO_CC1120_INT_PIN);
+
ao_radio_strobe(CC1120_SRX);
if (timeout)
ao_radio_strobe(CC1120_SRX);
if (timeout)
ao_clear_alarm();
if (ao_radio_abort) {
ao_clear_alarm();
if (ao_radio_abort) {
+ if (rx_task_id_save == 0)
+ ao_radio_burst_read_stop();