From 4dc8118c95b5ee43c730856c39f504c9778969e0 Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Wed, 5 Apr 2023 02:37:30 +0300 Subject: [PATCH] Add help/motd command --- flix/cli.ino | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/flix/cli.ino b/flix/cli.ino index f6dd01a..37a4b98 100644 --- a/flix/cli.ino +++ b/flix/cli.ino @@ -20,6 +20,7 @@ const char* motd = "| | | `----.| | / . \\\n" "|__| |_______||__| /__/ \\__\\\n\n" "Commands:\n\n" +"help - show help\n" "show - show all parameters\n" " - set parameter\n" "ps - show pitch/roll/yaw\n" @@ -30,7 +31,7 @@ const char* motd = "log - dump in-RAM log\n" "cg - calibrate gyro\n" "fullmot - test motor on all signals\n" -"wifi - start wi-fi access point\n\n"; +"wifi - start wi-fi access point\n"; bool showMotd = true; @@ -57,7 +58,9 @@ static const struct Param { static void doCommand() { - if (command == "show") { + if (command == "help" || command == "motd") { + Serial.println(motd); + } else if (command == "show") { showTable(); } else if (command == "ps") { Vector a = attitude.toEulerZYX(); @@ -121,7 +124,7 @@ static void doCommand() return; } } - Serial.println("Invalid command: '" + command + "'"); + Serial.println("Invalid command: " + command); } }