From 2901caad24e318b97632f24631a3ff1e7f0ad33e Mon Sep 17 00:00:00 2001 From: Aurel Feer Date: Wed, 1 Jun 2022 17:22:15 +0200 Subject: [PATCH] add core argument for run command --- usr/shelly/shelly.c | 2 +- usr/shelly/shelly_cmd.c | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/usr/shelly/shelly.c b/usr/shelly/shelly.c index 487fb3d..fcc6088 100644 --- a/usr/shelly/shelly.c +++ b/usr/shelly/shelly.c @@ -89,7 +89,7 @@ static void handle_lpuart_interrupt(void * arg) { shelly_reset_buffer(); - err = shelly_write_str("\n\r>"); + err = shelly_write_str("\n\ryou@windows me > "); if (err_is_fail(err)) USER_PANIC_ERR(err, "while trying to write string"); } else { err = shelly_buffer_append(input_char); diff --git a/usr/shelly/shelly_cmd.c b/usr/shelly/shelly_cmd.c index 30891ac..8ccf5a6 100644 --- a/usr/shelly/shelly_cmd.c +++ b/usr/shelly/shelly_cmd.c @@ -16,9 +16,11 @@ static errval_t shelly_cmd_help(char * line) { errval_t err; err = shelly_write_str("commands implemented:\n\r"); if (err_is_fail(err)) return err; - err = shelly_write_str("- echo\n\r"); + err = shelly_write_str("- echo [string]\n\r"); if (err_is_fail(err)) return err; - err = shelly_write_str("- run\n\r"); + err = shelly_write_str("- run [core] [binary]\n\r"); + if (err_is_fail(err)) return err; + err = shelly_write_str(" run a module from bootinfo\n\r"); if (err_is_fail(err)) return err; err = shelly_write_str("- ps\n\r"); if (err_is_fail(err)) return err; @@ -40,12 +42,15 @@ static errval_t shelly_cmd_run(char * line) { SHELLY_DEBUG("[shelly_cmd_run] line=%s\n", line); + char * module_line; + long core_id = strtol(line, &module_line, 10); + module_line += 1; // start process domainid_t pid; struct aos_rpc * rpc = aos_rpc_get_process_channel(); - err = aos_rpc_process_spawn(rpc, line, 0, &pid); + err = aos_rpc_process_spawn(rpc, module_line, core_id, &pid); if (err == SPAWN_ERR_FIND_MODULE) { - err = shelly_write_str("[run]:couldn't find module:\n\r"); + err = shelly_write_str("[run] couldn't find module:\n\r"); if (err_is_fail(err)) return err; err = shelly_write_str(line); if (err_is_fail(err)) return err;