diff options
| author | Bdale Garbee <bdale@gag.com> | 2015-07-16 13:31:42 -0600 | 
|---|---|---|
| committer | Bdale Garbee <bdale@gag.com> | 2015-07-16 13:31:42 -0600 | 
| commit | 6e9bb9178356620bd47d9f2e31abf42b7f1a8f11 (patch) | |
| tree | 6f04b5500462d1f6e26ebcba58c5e9cd56afd442 /src/drivers/ao_cc1200.c | |
| parent | e2cefd8593d269ce603aaf33f4a53a5c2dcb3350 (diff) | |
| parent | 87c8bb3956897830da1f7aaca2990a9571767b73 (diff) | |
Merge branch 'master' into branch-1.6
Diffstat (limited to 'src/drivers/ao_cc1200.c')
| -rw-r--r-- | src/drivers/ao_cc1200.c | 26 | 
1 files changed, 16 insertions, 10 deletions
| diff --git a/src/drivers/ao_cc1200.c b/src/drivers/ao_cc1200.c index 8546900e..6547be39 100644 --- a/src/drivers/ao_cc1200.c +++ b/src/drivers/ao_cc1200.c @@ -41,7 +41,11 @@ int8_t	ao_radio_rssi;			/* Last received RSSI value */  extern const uint32_t	ao_radio_cal; +#ifdef AO_CC1200_FOSC +#define FOSC	AO_CC1200_FOSC +#else  #define FOSC	40000000 +#endif  #define ao_radio_select()	ao_spi_get_mask(AO_CC1200_SPI_CS_PORT,(1 << AO_CC1200_SPI_CS_PIN),AO_CC1200_SPI_BUS,AO_SPI_SPEED_FAST)  #define ao_radio_deselect()	ao_spi_put_mask(AO_CC1200_SPI_CS_PORT,(1 << AO_CC1200_SPI_CS_PIN),AO_CC1200_SPI_BUS) @@ -301,20 +305,28 @@ ao_radio_idle(void)   *	CHANBW = 5.0 (round to 9.5)   */ +#if FOSC == 40000000  #define PACKET_SYMBOL_RATE_M		1013008 -  #define PACKET_SYMBOL_RATE_E_384	8 +#define PACKET_SYMBOL_RATE_E_96		6 +#define PACKET_SYMBOL_RATE_E_24		4 +#endif + +#if FOSC == 32000000 +#define PACKET_SYMBOL_RATE_M		239914 +#define PACKET_SYMBOL_RATE_E_384	9 +#define PACKET_SYMBOL_RATE_E_96		7 +#define PACKET_SYMBOL_RATE_E_24		5 +#endif  /* 200 / 2 = 100 */  #define PACKET_CHAN_BW_384	((CC1200_CHAN_BW_ADC_CIC_DECFACT_12 << CC1200_CHAN_BW_ADC_CIC_DECFACT) | \  				 (16 << CC1200_CHAN_BW_BB_CIC_DECFACT)) -#define PACKET_SYMBOL_RATE_E_96		6  /* 200 / 10 = 20 */  #define PACKET_CHAN_BW_96	((CC1200_CHAN_BW_ADC_CIC_DECFACT_48 << CC1200_CHAN_BW_ADC_CIC_DECFACT) | \  				 (16 << CC1200_CHAN_BW_BB_CIC_DECFACT)) -#define PACKET_SYMBOL_RATE_E_24		4  /* 200 / 25 = 8 */  #define PACKET_CHAN_BW_24	((CC1200_CHAN_BW_ADC_CIC_DECFACT_48 << CC1200_CHAN_BW_ADC_CIC_DECFACT) | \  				 (44 << CC1200_CHAN_BW_BB_CIC_DECFACT)) @@ -715,17 +727,11 @@ ao_radio_show_state(char *where)  static void  ao_radio_wait_isr(uint16_t timeout)  { -	if (timeout) -		ao_alarm(timeout); -  	ao_arch_block_interrupts();  	while (!ao_radio_wake && !ao_radio_abort) -		if (ao_sleep(&ao_radio_wake)) +		if (ao_sleep_for(&ao_radio_wake, timeout))  			ao_radio_abort = 1;  	ao_arch_release_interrupts(); - -	if (timeout) -		ao_clear_alarm();  }  static void | 
