altos: Save memory in ao_config.c
authorKeith Packard <keithp@keithp.com>
Sat, 7 Apr 2012 07:23:55 +0000 (00:23 -0700)
committerKeith Packard <keithp@keithp.com>
Sat, 7 Apr 2012 07:23:55 +0000 (00:23 -0700)
Shorten help messages.
Stop setting aes_key on products not using aes key.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/core/ao_config.c

index 08e6deeae1ef84ae6b9648fc0ddd366a0f023949..1dafab8dc0a5b8bdbe4a0063b9e7cbc345765537 100644 (file)
@@ -113,8 +113,10 @@ _ao_config_get(void)
                        ao_config.pad_orientation = AO_CONFIG_DEFAULT_PAD_ORIENTATION;
                if (ao_config.minor < 8)
                        ao_config.radio_enable = TRUE;
+#if HAS_AES
                if (ao_config.minor < 9)
-                       memset(&ao_config.aes_key, 0, AO_AES_LEN);
+                       ao_xmemset(&ao_config.aes_key, '\0', AO_AES_LEN);
+#endif
                if (ao_config.minor < 10) {
                        ao_config.frequency = 434550;
 #if HAS_RADIO_CHANNELS
@@ -525,12 +527,12 @@ ao_config_write(void) __reentrant;
 
 __code struct ao_config_var ao_config_vars[] = {
 #if HAS_ADC
-       { "m <meters>\0Main deploy (in meters)",
+       { "m <meters>\0Main deploy (m)",
          ao_config_main_deploy_set,    ao_config_main_deploy_show, },
-       { "d <delay>\0Apogee delay (in seconds)",
+       { "d <delay>\0Apogee delay (s)",
          ao_config_apogee_delay_set,   ao_config_apogee_delay_show },
 #endif /* HAS_ADC */
-       { "r <channel>\0Radio channel (freq = 434.550 + chan * .1)",
+       { "r <channel>\0Radio channel",
          ao_config_radio_channel_set,  ao_config_radio_channel_show },
        { "F <freq>\0Frequency (kHz)",
          ao_config_frequency_set, ao_config_frequency_show },
@@ -545,7 +547,7 @@ __code struct ao_config_var ao_config_vars[] = {
        { "f <cal>\0Radio calib (cal = rf/(xtal/2^16))",
          ao_config_radio_cal_set,      ao_config_radio_cal_show },
 #if HAS_LOG
-       { "l <size>\0Flight log size in kB",
+       { "l <size>\0Flight log size (kB)",
          ao_config_log_set,            ao_config_log_show },
 #endif
 #if HAS_IGNITE
@@ -637,7 +639,7 @@ ao_config_write(void) __reentrant
 #endif
 
 __code struct ao_cmds ao_config_cmds[] = {
-       { ao_config_set,        "c <var> <value>\0Set config variable (? for help, s to show)" },
+       { ao_config_set,        "c <var> <value>\0Set config (? for help, s to show)" },
        { 0, NULL },
 };