X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fdrivers%2Fao_cc1120.c;h=97a434d8975131338034ad1783c1e0e61bae5c7a;hb=310c1d0bf83448eb12e5d64ac09a4279c25fd258;hp=a36d922c15ac27bca4d28e75418e39665d2771d0;hpb=fb60d87b02c0fc83a0b4268212f0b6b740c984e3;p=fw%2Faltos diff --git a/src/drivers/ao_cc1120.c b/src/drivers/ao_cc1120.c index a36d922c..97a434d8 100644 --- a/src/drivers/ao_cc1120.c +++ b/src/drivers/ao_cc1120.c @@ -29,7 +29,7 @@ uint8_t ao_radio_in_recv; #define CC1120_DEBUG AO_FEC_DEBUG #define CC1120_TRACE 0 -const uint32_t ao_radio_cal = 0x6ca333; +extern const uint32_t ao_radio_cal; #define FOSC 32000000 @@ -729,7 +729,7 @@ ao_radio_recv(__xdata void *d, uint8_t size) /* Convert from 'real' rssi to cc1111-style values */ - rssi = (((int8_t) ao_radio_reg_read(CC1120_RSSI1)) + 74) * 2; + rssi = AO_RADIO_FROM_RSSI(ao_radio_reg_read(CC1120_RSSI1)); ao_radio_put(); @@ -998,7 +998,7 @@ ao_radio_test_recv() printf ("CRC OK"); else printf ("CRC BAD"); - printf (" RSSI %d", (int16_t) ((int8_t) bytes[32] >> 1) - 74); + printf (" RSSI %d", AO_RSSI_FROM_RADIO(bytes[32])); for (b = 0; b < 32; b++) printf (" %02x", bytes[b]); printf ("\n");