summaryrefslogtreecommitdiff
path: root/src/drivers/ao_cc1120.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-06-15 22:38:37 -0700
committerKeith Packard <keithp@keithp.com>2012-06-15 22:38:37 -0700
commitc2949ea15c59215834fedac7646f50c8a09f716f (patch)
tree71931409c6882860daf5834e16270fbf31180035 /src/drivers/ao_cc1120.c
parent1b7e4c29bf9608bfc972ae28b53cc823f4c37f92 (diff)
altos: Fix cc1120 packet mode datarate and config
Was using the wrong function Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/drivers/ao_cc1120.c')
-rw-r--r--src/drivers/ao_cc1120.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/drivers/ao_cc1120.c b/src/drivers/ao_cc1120.c
index 63f7cd89..68f7e736 100644
--- a/src/drivers/ao_cc1120.c
+++ b/src/drivers/ao_cc1120.c
@@ -406,17 +406,16 @@ ao_radio_recv(__xdata void *d, uint8_t size)
/*
* For our packet data, set the symbol rate to 38360 Baud
*
- * (2**20 - DATARATE_M) * 2 ** DATARATE_E
+ * (2**20 + DATARATE_M) * 2 ** DATARATE_E
* Rdata = -------------------------------------- * fosc
* 2 ** 39
*
- * DATARATE_M = 405002
- * DATARATE_E = 10
*
- * To make the tone last for 200ms, we need 2000 * .2 = 400 bits or 50 bytes
+ * DATARATE_M = 239914
+ * DATARATE_E = 9
*/
-#define PACKET_DRATE_E 10
-#define PACKET_DRATE_M 405002
+#define PACKET_DRATE_E 9
+#define PACKET_DRATE_M 239914
static const uint16_t packet_setup[] = {
CC1120_DEVIATION_M, PACKET_DEV_M,
@@ -433,6 +432,11 @@ static const uint16_t packet_setup[] = {
(CC1120_PKT_CFG1_ADDR_CHECK_CFG_NONE << CC1120_PKT_CFG1_ADDR_CHECK_CFG) |
(CC1120_PKT_CFG1_CRC_CFG_DISABLED << CC1120_PKT_CFG1_CRC_CFG) |
(1 << CC1120_PKT_CFG1_APPEND_STATUS)),
+ CC1120_PKT_CFG0, ((0 << CC1120_PKT_CFG0_RESERVED7) |
+ (CC1120_PKT_CFG0_LENGTH_CONFIG_FIXED << CC1120_PKT_CFG0_LENGTH_CONFIG) |
+ (0 << CC1120_PKT_CFG0_PKG_BIT_LEN) |
+ (0 << CC1120_PKT_CFG0_UART_MODE_EN) |
+ (0 << CC1120_PKT_CFG0_UART_SWAP_EN)),
};
void