mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-22 10:30:13 +00:00
added get_rssi_packet for getting RSSI from the last packet received
This commit is contained in:
parent
eb08babd4c
commit
bc39f2a86c
@ -347,10 +347,17 @@ cc1020_off(void)
|
||||
uint8_t
|
||||
cc1020_get_rssi(void)
|
||||
{
|
||||
rssi = cc1020_read_reg(CC1020_RSS);
|
||||
return cc1020_read_reg(CC1020_RSS);
|
||||
}
|
||||
|
||||
uint8_t
|
||||
cc1020_get_packet_rssi(void)
|
||||
{
|
||||
return rssi;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int
|
||||
cc1020_carrier_sense(void)
|
||||
{
|
||||
@ -423,7 +430,10 @@ interrupt(UART0RX_VECTOR) cc1020_rxhandler(void)
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
// Update RSSI.
|
||||
/* Update RSSI.
|
||||
TODO: add sampling/averaging of several RSSI to get
|
||||
more reliable RSSI values
|
||||
*/
|
||||
rssi = cc1020_read_reg(CC1020_RSS);
|
||||
CC1020_SET_OPSTATE(CC1020_RX | CC1020_RX_RECEIVING);
|
||||
} else if (cc1020_state & CC1020_RX_RECEIVING) {
|
||||
|
@ -60,6 +60,7 @@ void cc1020_set_tx(void);
|
||||
void cc1020_set_power(uint8_t pa_power);
|
||||
int cc1020_carrier_sense(void);
|
||||
uint8_t cc1020_get_rssi(void);
|
||||
uint8_t cc1020_get_packet_rssi(void);
|
||||
int cc1020_sending(void);
|
||||
|
||||
int cc1020_send(const void *buf, unsigned short size);
|
||||
|
Loading…
Reference in New Issue
Block a user