diff options
author | Mike Ryan <mikeryan@lacklustre.net> | 2016-03-02 17:33:20 -0800 |
---|---|---|
committer | Mike Ryan <mikeryan@lacklustre.net> | 2016-03-04 16:38:53 -0800 |
commit | cc4faea7a6a2af24b0b60dbc314bf89a2d149e59 (patch) | |
tree | 9bcb5baebd998bb0cdd973708bbb8ddee27a1309 /firmware/bluetooth_rxtx | |
parent | 01ec26a6e7b33d5e13501e85f13ca8dc4e38ec63 (diff) |
le: strobe SFSON as early as possible to regain precious microseconds
Diffstat (limited to 'firmware/bluetooth_rxtx')
-rw-r--r-- | firmware/bluetooth_rxtx/bluetooth_rxtx.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/firmware/bluetooth_rxtx/bluetooth_rxtx.c b/firmware/bluetooth_rxtx/bluetooth_rxtx.c index d57ff4e..ced2df2 100644 --- a/firmware/bluetooth_rxtx/bluetooth_rxtx.c +++ b/firmware/bluetooth_rxtx/bluetooth_rxtx.c @@ -1817,6 +1817,9 @@ void bt_le_sync(u8 active_mode) } DIO_SSP_DMACR &= ~SSPDMACR_RXDMAE; + // strobe SFSON to allow the resync to occur while we process the packet + cc2400_strobe(SFSON); + // unwhiten the rest of the packet for (i = 4; i < 44; i += 4) { uint32_t v = rxbuf1[i+0] << 24 @@ -1842,8 +1845,8 @@ void bt_le_sync(u8 active_mode) le.last_packet = CLK100NS; rx_flush: + // this might happen twice, but it's safe to do so cc2400_strobe(SFSON); - while (!(cc2400_status() & FS_LOCK)); // flush any excess bytes from the SSP's buffer DIO_SSP_DMACR &= ~SSPDMACR_RXDMAE; @@ -1905,6 +1908,8 @@ void bt_le_sync(u8 active_mode) cc2400_rx_sync(rbit(le.access_address)); restart_jamming = 0; } else { + // wait till we're in FSLOCK before strobing RX + while (!(cc2400_status() & FS_LOCK)); cc2400_strobe(SRX); } } |