cc1200: use Hz instead of kHz for channel spacing

This commit is contained in:
Simon Duquennoy 2016-09-22 11:27:18 +02:00
parent 3f4436bac9
commit 97843ed322
3 changed files with 5 additions and 5 deletions

View file

@ -47,8 +47,8 @@
/* Base frequency in kHz */
#define RF_CFG_CHAN_CENTER_F0 863125
/* Channel spacing in kHz */
#define RF_CFG_CHAN_SPACING 200
/* Channel spacing in Hz */
#define RF_CFG_CHAN_SPACING 200000
/* The minimum channel */
#define RF_CFG_MIN_CHANNEL 0
/* The maximum channel */

View file

@ -69,8 +69,8 @@ typedef struct cc1200_rf_cfg {
rtimer_clock_t tx_pkt_lifetime;
/* Base frequency in kHz */
uint32_t chan_center_freq0;
/* Channel spacing in kHz */
uint16_t chan_spacing;
/* Channel spacing in Hz */
uint32_t chan_spacing;
/* The minimum channel */
uint8_t min_channel;
/* The maximum channel */

View file

@ -2013,7 +2013,7 @@ calculate_freq(uint8_t channel)
uint32_t freq;
freq = CC1200_RF_CFG.chan_center_freq0 + channel * CC1200_RF_CFG.chan_spacing;
freq = CC1200_RF_CFG.chan_center_freq0 + (channel * CC1200_RF_CFG.chan_spacing) / 1000 /* /1000 because chan_spacing is in Hz */;
freq *= FREQ_MULTIPLIER;
freq /= FREQ_DIVIDER;