summaryrefslogtreecommitdiff
path: root/software/mpu
diff options
context:
space:
mode:
Diffstat (limited to 'software/mpu')
-rw-r--r--software/mpu/usb-cdc-shell.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/software/mpu/usb-cdc-shell.c b/software/mpu/usb-cdc-shell.c
index 1670d86..7d9171a 100644
--- a/software/mpu/usb-cdc-shell.c
+++ b/software/mpu/usb-cdc-shell.c
@@ -231,6 +231,32 @@ static void cmd_test(BaseSequentialStream *chp, int argc, char *argv[])
chThdWait(tp);
}
+static void cmd_flash(BaseSequentialStream *chp, int argc, char *argv[])
+{
+ (void)argv;
+ if (argc != 1) {
+ chprintf(chp, "Usage: flash (ihu|ctr|bat)\r\n");
+ return;
+ }
+ chprintf(chp, "connecting to bootloader of '%s' .. ", argv[0]);
+ if(!strcmp("ihu", argv[0])) {
+ // TODO: prepare IHU
+ chprintf(chp, "done\r\n");
+ } else if(!strcmp("ctr",argv[0])) {
+ // TODO: prepare IHU
+ chprintf(chp, "done\r\n");
+ } else if(!strcmp("bat", argv[0])) {
+ // TODO: prepare IHU
+ chprintf(chp, "done\r\n");
+ } else {
+ chprintf(chp, "error: target unknown\r\n");
+ return;
+ }
+
+ chprintf(chp, " after downloading and flashing has been finished\r\n", argv[0]);
+ chprintf(chp, " disconnect and reconnect the USB cable to restart shell\r\n", argv[0]);
+}
+
static void cmd_halt(BaseSequentialStream *chp, int argc, char *argv[])
{
(void)argv;
@@ -274,6 +300,7 @@ static const ShellCommand commands[] = {
{"mem", cmd_mem},
{"threads", cmd_threads},
{"test", cmd_test},
+ {"flash", cmd_flash},
{"halt", cmd_halt},
{"reboot", cmd_reboot},
{"bootloader", cmd_bootloader},