diff options
| author | Keith Packard <keithp@keithp.com> | 2014-06-22 21:05:05 -0700 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2014-06-22 21:05:05 -0700 | 
| commit | 3f3382126bf1122b1a78abe8458af5ec112a1f95 (patch) | |
| tree | 1a187ac3838ca13506cd16a0e328de162287156f /src/kernel/ao_config.c | |
| parent | ca1c62ca3ea016a1a5baa4520e484c102280c3e3 (diff) | |
altos: Make APRS SSID configurable
This uses the low-digit from the serial number by default, but lets
the user change it if desired.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/kernel/ao_config.c')
| -rw-r--r-- | src/kernel/ao_config.c | 34 | 
1 files changed, 34 insertions, 0 deletions
| diff --git a/src/kernel/ao_config.c b/src/kernel/ao_config.c index 71445335..58fa7354 100644 --- a/src/kernel/ao_config.c +++ b/src/kernel/ao_config.c @@ -61,6 +61,7 @@ __xdata uint8_t ao_config_mutex;  #define AO_CONFIG_DEFAULT_RADIO_POWER		0x60  #endif  #define AO_CONFIG_DEFAULT_RADIO_AMP		0 +#define AO_CONFIG_DEFAULT_APRS_SSID		(ao_serial_number % 10)  #if HAS_EEPROM  static void @@ -192,6 +193,10 @@ _ao_config_get(void)  		if (minor < 18)  			ao_config.pyro_time = AO_CONFIG_DEFAULT_PYRO_TIME;  #endif +#if HAS_APRS +		if (minor < 19) +			ao_config.aprs_ssid = AO_CONFIG_DEFAULT_APRS_SSID; +#endif  		ao_config.minor = AO_CONFIG_MINOR;  		ao_config_dirty = 1;  	} @@ -283,6 +288,7 @@ ao_config_frequency_set(void) __reentrant  	ao_radio_recv_abort();  #endif  } +  #endif  #if HAS_FLIGHT @@ -737,6 +743,30 @@ ao_config_pyro_time_set(void)  }  #endif +#if HAS_APRS +void +ao_config_aprs_ssid_show(void) +{ +	printf ("APRS SSID: %d\n", +		ao_config.aprs_ssid); +} + +void +ao_config_aprs_ssid_set(void) +{ +	ao_cmd_decimal(); +	if (ao_cmd_status != ao_cmd_success) +		return; +	if (15 < ao_cmd_lex_i) { +		ao_cmd_status = ao_cmd_lex_error; +		return; +	} +	_ao_config_edit_start(); +	ao_config.aprs_ssid = ao_cmd_lex_i; +	_ao_config_edit_finish(); +} +#endif /* HAS_APRS */ +  struct ao_config_var {  	__code char	*str;  	void		(*set)(void) __reentrant; @@ -817,6 +847,10 @@ __code struct ao_config_var ao_config_vars[] = {  	{ "t <motion> <interval>\0Tracker configuration",  	  ao_config_tracker_set, ao_config_tracker_show },  #endif +#if HAS_APRS +	{ "S <ssid>\0Set APRS SSID (0-15)", +	  ao_config_aprs_ssid_set, ao_config_aprs_ssid_show }, +#endif  	{ "s\0Show",  	  ao_config_show,		0 },  #if HAS_EEPROM | 
