From 9d095eb1987f35d0d4e6540bf335e1faaa7c86ec Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 6 Dec 2012 16:29:36 -0800 Subject: altos: Shrink 'ao_version' by calling printf fewer times Each printf call costs quite a bit of code space on the cc1111, so instead of making multiple short calls, make one longer one. Signed-off-by: Keith Packard --- src/core/ao_cmd.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'src/core/ao_cmd.c') diff --git a/src/core/ao_cmd.c b/src/core/ao_cmd.c index a3330974..9e78a225 100644 --- a/src/core/ao_cmd.c +++ b/src/core/ao_cmd.c @@ -265,12 +265,25 @@ ao_reboot(void) static void version(void) { - printf("manufacturer %s\n", ao_manufacturer); - printf("product %s\n", ao_product); - printf("serial-number %u\n", ao_serial_number); + printf("manufacturer %s\n" + "product %s\n" + "serial-number %u\n" +#if HAS_FLIGHT + "flight-number %u\n" +#endif +#if HAS_LOG + "log-format %u\n" +#endif + , ao_manufacturer + , ao_product + , ao_serial_number +#if HAS_FLIGHT + , ao_flight_number +#endif #if HAS_LOG - printf("log-format %u\n", ao_log_format); + , ao_log_format #endif + ); #if HAS_MS5607 ao_ms5607_info(); #endif -- cgit v1.2.3 From b4e86af6de52ea0bacf80e3936b6cd17c1cbf898 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 6 Dec 2012 17:06:17 -0800 Subject: altos: Change 'flight-number' to 'current-flight' Avoids ambiguity with stored flight info, which starts lines with 'flight'. Signed-off-by: Keith Packard --- src/core/ao_cmd.c | 2 +- src/core/ao_config.c | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'src/core/ao_cmd.c') diff --git a/src/core/ao_cmd.c b/src/core/ao_cmd.c index 9e78a225..3d086a57 100644 --- a/src/core/ao_cmd.c +++ b/src/core/ao_cmd.c @@ -269,7 +269,7 @@ version(void) "product %s\n" "serial-number %u\n" #if HAS_FLIGHT - "flight-number %u\n" + "current-flight %u\n" #endif #if HAS_LOG "log-format %u\n" diff --git a/src/core/ao_config.c b/src/core/ao_config.c index e85ddcb4..797fe7ec 100644 --- a/src/core/ao_config.c +++ b/src/core/ao_config.c @@ -529,15 +529,15 @@ __code struct ao_config_var ao_config_vars[] = { ao_config_callsign_set, ao_config_callsign_show }, { "e <0 disable, 1 enable>\0Enable telemetry and RDF", ao_config_radio_enable_set, ao_config_radio_enable_show }, + { "f \0Radio calib (cal = rf/(xtal/2^16))", + ao_config_radio_cal_set, ao_config_radio_cal_show }, #endif /* HAS_RADIO */ #if HAS_ACCEL { "a <+g> <-g>\0Accel calib (0 for auto)", ao_config_accel_calibrate_set,ao_config_accel_calibrate_show }, + { "o <0 antenna up, 1 antenna down>\0Set pad orientation", + ao_config_pad_orientation_set,ao_config_pad_orientation_show }, #endif /* HAS_ACCEL */ -#if HAS_RADIO - { "f \0Radio calib (cal = rf/(xtal/2^16))", - ao_config_radio_cal_set, ao_config_radio_cal_show }, -#endif /* HAS_RADIO */ #if HAS_LOG { "l \0Flight log size (kB)", ao_config_log_set, ao_config_log_show }, @@ -546,10 +546,6 @@ __code struct ao_config_var ao_config_vars[] = { { "i <0 dual, 1 apogee, 2 main>\0Set igniter mode", ao_config_ignite_mode_set, ao_config_ignite_mode_show }, #endif -#if HAS_ACCEL - { "o <0 antenna up, 1 antenna down>\0Set pad orientation", - ao_config_pad_orientation_set,ao_config_pad_orientation_show }, -#endif #if HAS_AES { "k <32 hex digits>\0Set AES encryption key", ao_config_key_set, ao_config_key_show }, -- cgit v1.2.3