diff options
author | Keith Packard <keithp@keithp.com> | 2012-12-25 14:20:42 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-12-25 14:20:42 -0800 |
commit | 868ef0c9c4b208c02a87180b0eede329369bdc77 (patch) | |
tree | 1f20d312d56bac34bad12f287629a2651bbbccf8 /src/core/ao_cmd.c | |
parent | 669cde8a87d88ceae89e369c1d38b88c9f8198cf (diff) | |
parent | 57487e78b90465a21c87cf30deb0aeaba0887332 (diff) |
Merge branch 'master' into micropeak-logging
Diffstat (limited to 'src/core/ao_cmd.c')
-rw-r--r-- | src/core/ao_cmd.c | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/src/core/ao_cmd.c b/src/core/ao_cmd.c index 1814cecf..3d086a57 100644 --- a/src/core/ao_cmd.c +++ b/src/core/ao_cmd.c @@ -110,6 +110,22 @@ putnibble(uint8_t v) putchar(v + ('a' - 10)); } +uint8_t +ao_getnibble(void) +{ + char c; + + c = getchar(); + if ('0' <= c && c <= '9') + return c - '0'; + if ('a' <= c && c <= 'f') + return c - ('a' - 10); + if ('A' <= c && c <= 'F') + return c - ('A' - 10); + ao_cmd_status = ao_cmd_lex_error; + return 0; +} + void ao_cmd_put16(uint16_t v) { @@ -249,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 + "current-flight %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 |