mirror of
https://github.com/okalachev/flix.git
synced 2026-01-10 04:57:17 +00:00
Simplify command for command handling
This commit is contained in:
@@ -74,9 +74,10 @@ void doCommand(String str, bool echo = false) {
|
|||||||
// parse command
|
// parse command
|
||||||
String command, arg0, arg1;
|
String command, arg0, arg1;
|
||||||
splitString(str, command, arg0, arg1);
|
splitString(str, command, arg0, arg1);
|
||||||
|
if (command.isEmpty()) return;
|
||||||
|
|
||||||
// echo command
|
// echo command
|
||||||
if (echo && !command.isEmpty()) {
|
if (echo) {
|
||||||
print("> %s\n", str.c_str());
|
print("> %s\n", str.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,8 +171,6 @@ void doCommand(String str, bool echo = false) {
|
|||||||
attitude = Quaternion();
|
attitude = Quaternion();
|
||||||
} else if (command == "reboot") {
|
} else if (command == "reboot") {
|
||||||
ESP.restart();
|
ESP.restart();
|
||||||
} else if (command == "") {
|
|
||||||
// do nothing
|
|
||||||
} else {
|
} else {
|
||||||
print("Invalid command: %s\n", command.c_str());
|
print("Invalid command: %s\n", command.c_str());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user