ao_match_word(__code char *word);
struct ao_cmds {
- char cmd;
void (*func)(void);
const char *help;
};
}
__code struct ao_cmds ao_adc_cmds[] = {
- { 'a', ao_adc_dump, "a Display current ADC values" },
- { 0, ao_adc_dump, NULL },
+ { ao_adc_dump, "a\0Display current ADC values" },
+ { 0, NULL },
};
void
puts(help_txt);
for (cmds = 0; cmds < ao_ncmds; cmds++) {
cs = ao_cmds[cmds];
- for (cmd = 0; cs[cmd].cmd != '\0'; cmd++)
- puts(cs[cmd].help);
+ for (cmd = 0; cs[cmd].func; cmd++)
+ printf("%-45s %s\n",
+ cs[cmd].help,
+ cs[cmd].help+1+strlen(cs[cmd].help));
}
}
func = (void (*)(void)) NULL;
for (cmds = 0; cmds < ao_ncmds; cmds++) {
cs = ao_cmds[cmds];
- for (cmd = 0; cs[cmd].cmd != '\0'; cmd++)
- if (cs[cmd].cmd == c) {
+ for (cmd = 0; cs[cmd].func; cmd++)
+ if (cs[cmd].help[0] == c) {
func = cs[cmd].func;
break;
}
__xdata struct ao_task ao_cmd_task;
__code struct ao_cmds ao_base_cmds[] = {
- { '?', help, "? Print this message" },
- { 'T', ao_task_info, "T Show task states" },
- { 'E', echo, "E <0 off, 1 on> Set command echo mode" },
- { 'r', ao_reboot, "r eboot Reboot" },
- { 'v', version, "v Show version" },
- { 0, help, NULL },
+ { help, "?\0Print this message" },
+ { ao_task_info, "T\0Show task states" },
+ { echo, "E <0 off, 1 on>\0Set command echo mode" },
+ { ao_reboot, "r eboot\0Reboot" },
+ { version, "v\0Show version" },
+ { 0, NULL },
};
void
#endif
__code struct ao_cmds ao_config_cmds[] = {
- { 'c', ao_config_set, "c <var> <value> Set config variable (? for help, s to show)" },
- { '\0', ao_config_set, NULL },
+ { ao_config_set, "c <var> <value>\0Set config variable (? for help, s to show)" },
+ { 0, NULL },
};
void
}
__code struct ao_cmds ao_dbg_cmds[7] = {
- { 'D', debug_enable, "D Enable debug mode" },
- { 'G', debug_get, "G <count> Get data from debug port" },
- { 'I', debug_input, "I <count> <addr> Input <count> bytes to target at <addr>" },
- { 'O', debug_output, "O <count> <addr> Output <count> bytes to target at <addr>" },
- { 'P', debug_put, "P <byte> ... Put data to debug port" },
- { 'R', debug_reset, "R Reset target" },
- { 0, debug_reset, 0 },
+ { debug_enable, "D\0Enable debug mode" },
+ { debug_get, "G <count>\0Get data from debug port" },
+ { debug_input, "I <count> <addr>\0Input <count> bytes to target at <addr>" },
+ { debug_output, "O <count> <addr>\0Output <count> bytes to target at <addr>" },
+ { debug_put, "P <byte> ...\0Put data to debug port" },
+ { debug_reset, "R\0Reset target" },
+ { 0, NULL },
};
void
};
struct ao_cmds {
- char cmd;
void (*func)(void);
const char *help;
};
}
__code struct ao_cmds ao_gps_cmds[] = {
- { 'g', gps_dump, "g Display current GPS values" },
- { 0, gps_dump, NULL },
+ { gps_dump, "g\0Display current GPS values" },
+ { 0, NULL },
};
void
};
struct ao_cmds {
- char cmd;
void (*func)(void);
const char *help;
};
}
__code struct ao_cmds ao_ignite_cmds[] = {
- { 'i', ao_ignite_manual, "i <key> {main|drogue} Fire igniter. <key> is doit with D&I" },
- { 't', ao_ignite_test, "t Test igniter continuity" },
- { 0, ao_ignite_manual, NULL },
+ { ao_ignite_manual, "i <key> {main|drogue}\0Fire igniter. <key> is doit with D&I" },
+ { ao_ignite_test, "t\0Test igniter continuity" },
+ { 0, NULL },
};
__xdata struct ao_task ao_igniter_task;
__code struct ao_cmds ao_log_cmds[] = {
- { 'l', ao_log_list, "l List stored flight logs" },
- { 'd', ao_log_delete, "d <flight-number> Delete stored flight" },
- { 0, ao_log_delete, NULL },
+ { ao_log_list, "l\0List stored flight logs" },
+ { ao_log_delete, "d <flight-number>\0Delete stored flight" },
+ { 0, NULL },
};
void
}
__code struct ao_cmds ao_monitor_cmds[] = {
- { 'm', set_monitor, "m <0 off, 1 on> Enable/disable radio monitoring" },
- { 0, set_monitor, NULL },
+ { set_monitor, "m <0 off, 1 on>\0Enable/disable radio monitoring" },
+ { 0, NULL },
};
void
__code struct ao_cmds ao_packet_master_cmds[] = {
- { 'p', ao_packet_forward, "p Remote packet link." },
- { 0, ao_packet_forward, NULL },
+ { ao_packet_forward, "p\0Remote packet link." },
+ { 0, NULL },
};
void
}
__code struct ao_cmds ao_radio_cmds[] = {
- { 'C', ao_radio_test, "C <1 start, 0 stop, none both> Radio carrier test" },
- { 0, ao_radio_test, NULL },
+ { ao_radio_test, "C <1 start, 0 stop, none both>\0Radio carrier test" },
+ { 0, NULL },
};
void
}
__code struct ao_cmds ao_serial_cmds[] = {
- { 'M', monitor_serial, "M <enable> Monitor serial data" },
- { 0, monitor_serial, NULL },
+ { monitor_serial, "M <enable>\0Monitor serial data" },
+ { 0, NULL },
};
static const struct {
}
__code struct ao_cmds ao_storage_cmds[] = {
- { 'f', ao_storage_info, "f Show storage info" },
- { 'e', ao_storage_dump, "e <block> Dump a block of flash data" },
-#if 0
- { 'w', ao_storage_store, "w <block> <start> <len> <data> ... Write data to flash" },
+#ifdef HAS_STORAGE_DBG
+ { ao_storage_store, "w <block> <start> <len> <data> ...\0Write data to flash" },
#endif
- { 'z', ao_storage_zap, "z <block> Erase flash containing <block>" },
- { 'Z', ao_storage_zapall,"Z <key> Erase all logs. <key> is doit with D&I" },
- { 0, ao_storage_zap, NULL },
+ { ao_storage_zap, "z <block>\0Erase flash containing <block>" },
+ { ao_storage_zapall,"Z <key>\0Erase all logs. <key> is doit with D&I" },
+ { 0, NULL },
};
void