From: Keith Packard Date: Sat, 16 Jun 2012 05:38:37 +0000 (-0700) Subject: altos: Fix cc1120 packet mode datarate and config X-Git-Tag: 1.0.9.6~70 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=c2949ea15c59215834fedac7646f50c8a09f716f;p=fw%2Faltos altos: Fix cc1120 packet mode datarate and config Was using the wrong function Signed-off-by: Keith Packard --- 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