From 81037d94ecaa5c50574470027a9f719bdcecc4c6 Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Tue, 6 May 2025 03:16:45 +0300 Subject: [PATCH] Some cli improvements Improve loop rate formatting Show cpu temperature in sys command --- flix/cli.ino | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/flix/cli.ino b/flix/cli.ino index 1b4df51..cfe0664 100644 --- a/flix/cli.ino +++ b/flix/cli.ino @@ -36,7 +36,7 @@ const char* motd = "cr - calibrate RC\n" "ca - calibrate accel\n" "mfr, mfl, mrr, mrl - test motor (remove props)\n" -"sys - show system information\n" +"sys - show system info\n" "reset - reset drone's state\n" "reboot - reboot the drone\n"; @@ -96,7 +96,7 @@ void doCommand(String str, bool echo = false) { resetParameters(); } else if (command == "time") { print("Time: %f\n", t); - print("Loop rate: %f\n", loopRate); + print("Loop rate: %.0f\n", loopRate); print("dt: %f\n", dt); } else if (command == "ps") { Vector a = attitude.toEulerZYX(); @@ -108,7 +108,7 @@ void doCommand(String str, bool echo = false) { print("gyro: %f %f %f\n", rates.x, rates.y, rates.z); print("acc: %f %f %f\n", acc.x, acc.y, acc.z); printIMUCal(); - print("rate: %f\n", loopRate); + print("rate: %.0f\n", loopRate); print("landed: %d\n", landed); } else if (command == "rc") { print("Raw: throttle %d yaw %d pitch %d roll %d armed %d mode %d\n", @@ -138,6 +138,7 @@ void doCommand(String str, bool echo = false) { } else if (command == "sys") { #ifdef ESP32 print("Chip: %s\n", ESP.getChipModel()); + print("Temperature: %.1f °C\n", temperatureRead()); print("Free heap: %d\n", ESP.getFreeHeap()); // Print tasks table print("Num Task Stack Prio Core CPU%%\n");