From 25c5f0b744970343841edd3d7d26215d60fceefc Mon Sep 17 00:00:00 2001 From: Atis Elsts Date: Mon, 25 Apr 2016 19:23:59 +0300 Subject: [PATCH] cc26xx: implement support for CC2650_FAST_RADIO_STARTUP --- cpu/cc26xx-cc13xx/rf-core/ieee-mode.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/cpu/cc26xx-cc13xx/rf-core/ieee-mode.c b/cpu/cc26xx-cc13xx/rf-core/ieee-mode.c index f81faf1c3..b67bddac0 100644 --- a/cpu/cc26xx-cc13xx/rf-core/ieee-mode.c +++ b/cpu/cc26xx-cc13xx/rf-core/ieee-mode.c @@ -1216,11 +1216,13 @@ on(void) return RF_CORE_CMD_OK; } +#if !CC2650_FAST_RADIO_STARTUP /* * Request the HF XOSC as the source for the HF clock. Needed before we can * use the FS. This will only request, it will _not_ perform the switch. */ oscillators_request_hf_xosc(); +#endif if(rf_is_on()) { PRINTF("on: We were on. PD=%u, RX=0x%04x \n", rf_core_is_accessible(), @@ -1228,22 +1230,23 @@ on(void) return RF_CORE_CMD_OK; } + init_rx_buffers(); + + /* + * Trigger a switch to the XOSC, so that we can subsequently use the RF FS + * This will block until the XOSC is actually ready, but give how we + * requested it early on, this won't be too long a wait. + * This should be done before starting the RAT. + */ + oscillators_switch_to_hf_xosc(); + if(rf_core_boot() != RF_CORE_CMD_OK) { PRINTF("on: rf_core_boot() failed\n"); return RF_CORE_CMD_ERROR; } - init_rx_buffers(); - rf_core_setup_interrupts(poll_mode); - /* - * Trigger a switch to the XOSC, so that we can subsequently use the RF FS - * This will block until the XOSC is actually ready, but give how we - * requested it early on, this won't be too long a wait/ - */ - oscillators_switch_to_hf_xosc(); - if(rf_radio_setup() != RF_CORE_CMD_OK) { PRINTF("on: radio_setup() failed\n"); return RF_CORE_CMD_ERROR; @@ -1272,8 +1275,12 @@ off(void) ENERGEST_OFF(ENERGEST_TYPE_LISTEN); - /* Switch HF clock source to the RCOSC to preserve power */ +#if !CC2650_FAST_RADIO_STARTUP + /* Switch HF clock source to the RCOSC to preserve power. + * This must be done after stopping RAT. + */ oscillators_switch_to_hf_rc(); +#endif /* We pulled the plug, so we need to restore the status manually */ ((rfc_CMD_IEEE_RX_t *)cmd_ieee_rx_buf)->status = RF_CORE_RADIO_OP_STATUS_IDLE;