X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fcore%2Fao_cmd.c;h=6eed08d91931a401da9d4c325e9f3f34b247eb1a;hb=887209b61ac3012d0fd2206cf1016c44f59cb432;hp=9e78a225e118e16d810b5706c2a57fe10121b670;hpb=9d095eb1987f35d0d4e6540bf335e1faaa7c86ec;p=fw%2Faltos diff --git a/src/core/ao_cmd.c b/src/core/ao_cmd.c index 9e78a225..6eed08d9 100644 --- a/src/core/ao_cmd.c +++ b/src/core/ao_cmd.c @@ -28,8 +28,8 @@ static __xdata char cmd_line[CMD_LEN]; static __pdata uint8_t cmd_len; static __pdata uint8_t cmd_i; -static void -put_string(__code char *s) +void +ao_put_string(__code char *s) { char c; while ((c = *s++)) @@ -39,7 +39,7 @@ put_string(__code char *s) static void backspace(void) { - put_string ("\010 \010"); + ao_put_string ("\010 \010"); } static void @@ -47,7 +47,7 @@ readline(void) { char c; if (ao_echo()) - put_string("> "); + ao_put_string("> "); cmd_len = 0; for (;;) { flush(); @@ -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" @@ -303,13 +303,21 @@ help(void) __pdata uint8_t cmds; __pdata uint8_t cmd; __code struct ao_cmds * __pdata cs; - const char *h; + __code const char *h; + uint8_t e; for (cmds = 0; cmds < ao_ncmds; cmds++) { cs = ao_cmds[cmds]; for (cmd = 0; cs[cmd].func; cmd++) { h = cs[cmd].help; - printf("%-45s %s\n", h, h + 1 + strlen(h)); + ao_put_string(h); + e = strlen(h); + h += e + 1; + e = 45 - e; + while (e--) + putchar(' '); + ao_put_string(h); + putchar('\n'); } } }