diff options
| author | Keith Packard <keithp@keithp.com> | 2009-12-05 15:36:12 -0800 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2009-12-05 15:37:33 -0800 | 
| commit | 46f03ab3145a61139c8ca6fc99e8f2798728b5a9 (patch) | |
| tree | 73ccbbe914fbe9e378134d3620fcd0b35487bc36 | |
| parent | bf29a62532fec12e6af2d2f3a6624882c863e933 (diff) | |
Re-order config values. Change frequency to cal
Place more often used values at top, and consistently call the radio
value 'calibration' instead of 'frequency'.
Signed-off-by: Keith Packard <keithp@keithp.com>
| -rw-r--r-- | src/ao.h | 2 | ||||
| -rw-r--r-- | src/ao_config.c | 28 | ||||
| -rw-r--r-- | src/ao_radio.c | 6 | 
3 files changed, 18 insertions, 18 deletions
| @@ -949,7 +949,7 @@ struct ao_config {  	char		callsign[AO_MAX_CALLSIGN + 1];  	uint8_t		apogee_delay;		/* minor version 1 */  	int16_t		accel_minus_g;		/* minor version 2 */ -	uint32_t	radio_frequency;	/* minor version 3 */ +	uint32_t	radio_cal;		/* minor version 3 */  };  extern __xdata struct ao_config ao_config; diff --git a/src/ao_config.c b/src/ao_config.c index 27a60ac1..3609ec06 100644 --- a/src/ao_config.c +++ b/src/ao_config.c @@ -32,7 +32,7 @@ __xdata uint8_t ao_config_mutex;   *   * 434.550e6 / (24e6 / 2**16) = 1186611.2   */ -#define AO_CONFIG_DEFAULT_RADIO_FREQUENCY	1186611 +#define AO_CONFIG_DEFAULT_RADIO_CAL	1186611  static void  _ao_config_put(void) @@ -57,7 +57,7 @@ _ao_config_get(void)  		memcpy(&ao_config.callsign, AO_CONFIG_DEFAULT_CALLSIGN,  		       sizeof(AO_CONFIG_DEFAULT_CALLSIGN) - 1);  		ao_config.apogee_delay = AO_CONFIG_DEFAULT_APOGEE_DELAY; -		ao_config.radio_frequency = AO_CONFIG_DEFAULT_RADIO_FREQUENCY; +		ao_config.radio_cal = AO_CONFIG_DEFAULT_RADIO_CAL;  		ao_config_dirty = 1;  	}  	if (ao_config.minor < AO_CONFIG_MINOR) { @@ -71,7 +71,7 @@ _ao_config_get(void)  		}  		/* Fixups for minor version 3 */  		if (ao_config.minor < 3) -			ao_config.radio_frequency = AO_CONFIG_DEFAULT_RADIO_FREQUENCY; +			ao_config.radio_cal = AO_CONFIG_DEFAULT_RADIO_CAL;  		ao_config.minor = AO_CONFIG_MINOR;  		ao_config_dirty = 1;  	} @@ -256,23 +256,23 @@ ao_config_apogee_delay_set(void) __reentrant  }  void -ao_config_radio_frequency_show(void) __reentrant +ao_config_radio_cal_show(void) __reentrant  { -	printf("Radio frequency: %ld\n", ao_config.radio_frequency); +	printf("Radio cal: %ld\n", ao_config.radio_cal);  }  void -ao_config_radio_frequency_set(void) __reentrant +ao_config_radio_cal_set(void) __reentrant  {  	ao_cmd_decimal();  	if (ao_cmd_status != ao_cmd_success)  		return;  	ao_mutex_get(&ao_config_mutex);  	_ao_config_get(); -	ao_config.radio_frequency = ao_cmd_lex_u32; +	ao_config.radio_cal = ao_cmd_lex_u32;  	ao_config_dirty = 1;  	ao_mutex_put(&ao_config_mutex); -	ao_config_radio_frequency_show(); +	ao_config_radio_cal_show();  }  struct ao_config_var { @@ -294,16 +294,16 @@ ao_config_write(void) __reentrant;  __code struct ao_config_var ao_config_vars[] = {  	{ 'm',	ao_config_main_deploy_set,	ao_config_main_deploy_show,  		"m <meters>  Set height above launch for main deploy (in meters)" }, -	{ 'a',	ao_config_accel_calibrate_set,	ao_config_accel_calibrate_show, -		"a <+g> <-g> Set accelerometer calibration (0 for auto)" }, +	{ 'd',	ao_config_apogee_delay_set,	ao_config_apogee_delay_show, +	        "d <delay>   Set apogee igniter delay (in seconds)" },  	{ 'r',	ao_config_radio_channel_set,	ao_config_radio_channel_show,  		"r <channel> Set radio channel (freq = 434.550 + channel * .1)" }, -	{ 'f',  ao_config_radio_frequency_set,  ao_config_radio_frequency_show, -		"f <cal>     Set radio calibration value (cal = rf/(xtal/2^16))" },  	{ 'c',	ao_config_callsign_set,		ao_config_callsign_show,  		"c <call>    Set callsign broadcast in each packet (8 char max)" }, -	{ 'd',	ao_config_apogee_delay_set,	ao_config_apogee_delay_show, -	        "d <delay>   Set apogee igniter delay (in seconds)" }, +	{ 'a',	ao_config_accel_calibrate_set,	ao_config_accel_calibrate_show, +		"a <+g> <-g> Set accelerometer calibration (0 for auto)" }, +	{ 'f',  ao_config_radio_cal_set,  	ao_config_radio_cal_show, +		"f <cal>     Set radio calibration value (cal = rf/(xtal/2^16))" },  	{ 's',	ao_config_show,			ao_config_show,  		"s           Show current config values" },  	{ 'w',	ao_config_write,		ao_config_write, diff --git a/src/ao_radio.c b/src/ao_radio.c index 6d25df39..4dea6dce 100644 --- a/src/ao_radio.c +++ b/src/ao_radio.c @@ -331,9 +331,9 @@ ao_radio_get(void)  	ao_mutex_get(&ao_radio_mutex);  	ao_radio_idle();  	RF_CHANNR = ao_config.radio_channel; -	RF_FREQ2 = (uint8_t) (ao_config.radio_frequency >> 16); -	RF_FREQ1 = (uint8_t) (ao_config.radio_frequency >> 8); -	RF_FREQ0 = (uint8_t) (ao_config.radio_frequency); +	RF_FREQ2 = (uint8_t) (ao_config.radio_cal >> 16); +	RF_FREQ1 = (uint8_t) (ao_config.radio_cal >> 8); +	RF_FREQ0 = (uint8_t) (ao_config.radio_cal);  }  #define ao_radio_put() ao_mutex_put(&ao_radio_mutex) | 
