mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-25 09:35:42 +00:00
nrf5x: read RSSI for adv pdus
This commit is contained in:
parent
89fd9aef67
commit
aedec01ab0
@ -195,7 +195,9 @@ static void radio_init(void){
|
|||||||
|
|
||||||
// Shorts:
|
// Shorts:
|
||||||
// - READY->START
|
// - READY->START
|
||||||
NRF_RADIO->SHORTS = RADIO_SHORTS_READY_START_Enabled << RADIO_SHORTS_READY_START_Pos;
|
// - ADDRESS0>RSSISTART
|
||||||
|
NRF_RADIO->SHORTS = RADIO_SHORTS_READY_START_Enabled << RADIO_SHORTS_READY_START_Pos
|
||||||
|
| RADIO_SHORTS_ADDRESS_RSSISTART_Enabled << RADIO_SHORTS_ADDRESS_RSSISTART_Pos;
|
||||||
|
|
||||||
// Disable all interrrupts
|
// Disable all interrrupts
|
||||||
NRF_RADIO->INTENCLR = 0xffffffff;
|
NRF_RADIO->INTENCLR = 0xffffffff;
|
||||||
@ -279,7 +281,7 @@ void RADIO_IRQHandler(void){
|
|||||||
memcpy(&hci_outgoing_event[6], &rx_adv_buffer[2], 6);
|
memcpy(&hci_outgoing_event[6], &rx_adv_buffer[2], 6);
|
||||||
hci_outgoing_event[12] = len - 6; // rest after bd addr
|
hci_outgoing_event[12] = len - 6; // rest after bd addr
|
||||||
memcpy(&hci_outgoing_event[13], &rx_adv_buffer[8], len - 6);
|
memcpy(&hci_outgoing_event[13], &rx_adv_buffer[8], len - 6);
|
||||||
hci_outgoing_event[13 + len - 6] = 0; // TODO: measure RSSI and set here
|
hci_outgoing_event[13 + len - 6] = -NRF_RADIO->RSSISAMPLE; // RSSI is stored without sign but is negative
|
||||||
hci_outgoing_event_ready = 1;
|
hci_outgoing_event_ready = 1;
|
||||||
} else {
|
} else {
|
||||||
// ... for now, we just throw the adv away and try to receive the next one
|
// ... for now, we just throw the adv away and try to receive the next one
|
||||||
|
Loading…
x
Reference in New Issue
Block a user