projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos: Provide MS5611 configuration option, HAS_MS5611
[fw/altos]
/
src
/
drivers
/
ao_cc1120.c
diff --git
a/src/drivers/ao_cc1120.c
b/src/drivers/ao_cc1120.c
index a36d922c15ac27bca4d28e75418e39665d2771d0..2f9c296f25372926f99a92e88cf8ab593ad8a539 100644
(file)
--- 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
#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
#define FOSC 32000000
@@
-515,7
+515,7
@@
ao_radio_rdf_abort(void)
}
static void
}
static void
-ao_radio_test(void)
+ao_radio_test
_cmd
(void)
{
uint8_t mode = 2;
uint8_t radio_on;
{
uint8_t mode = 2;
uint8_t radio_on;
@@
-729,7
+729,7
@@
ao_radio_recv(__xdata void *d, uint8_t size)
/* Convert from 'real' rssi to cc1111-style values */
/* 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();
ao_radio_put();
@@
-998,7
+998,7
@@
ao_radio_test_recv()
printf ("CRC OK");
else
printf ("CRC BAD");
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");
for (b = 0; b < 32; b++)
printf (" %02x", bytes[b]);
printf ("\n");
@@
-1008,7
+1008,7
@@
ao_radio_test_recv()
#endif
static const struct ao_cmds ao_radio_cmds[] = {
#endif
static const struct ao_cmds ao_radio_cmds[] = {
- { ao_radio_test
,
"C <1 start, 0 stop, none both>\0Radio carrier test" },
+ { ao_radio_test
_cmd,
"C <1 start, 0 stop, none both>\0Radio carrier test" },
#if CC1120_DEBUG
{ ao_radio_show, "R\0Show CC1120 status" },
{ ao_radio_beep, "b\0Emit an RDF beacon" },
#if CC1120_DEBUG
{ ao_radio_show, "R\0Show CC1120 status" },
{ ao_radio_beep, "b\0Emit an RDF beacon" },
@@
-1028,12
+1028,12
@@
ao_radio_init(void)
AO_CC1120_SPI_CS_PORT->bsrr = ((uint32_t) (1 << AO_CC1120_SPI_CS_PIN));
for (i = 0; i < 10000; i++) {
AO_CC1120_SPI_CS_PORT->bsrr = ((uint32_t) (1 << AO_CC1120_SPI_CS_PIN));
for (i = 0; i < 10000; i++) {
- if ((SPI_2_
GPIO->idr & (1 << SPI_2_MISO
)) == 0)
+ if ((SPI_2_
PORT->idr & (1 << SPI_2_MISO_PIN
)) == 0)
break;
}
AO_CC1120_SPI_CS_PORT->bsrr = (1 << AO_CC1120_SPI_CS_PIN);
if (i == 10000)
break;
}
AO_CC1120_SPI_CS_PORT->bsrr = (1 << AO_CC1120_SPI_CS_PIN);
if (i == 10000)
- ao_panic(AO_PANIC_SELF_TEST);
+ ao_panic(AO_PANIC_SELF_TEST
_CC1120
);
/* Enable the EXTI interrupt for the appropriate pin */
ao_enable_port(AO_CC1120_INT_PORT);
/* Enable the EXTI interrupt for the appropriate pin */
ao_enable_port(AO_CC1120_INT_PORT);