commit ea14873e5acb127fc49be3d31ebe0f9c07999390
parent 742d5ba1d2fd000e7a6e9eeed62bc0128efbc72d
Author: minute <lukas@mntre.com>
Date: Fri, 19 Jan 2024 12:45:20 +0000
Merge branch 'f-u-commands' into 'master'
New LPC commands: f, 1f, 2f, 3f and U
See merge request reform/reform!63
Diffstat:
1 file changed, 20 insertions(+), 0 deletions(-)
diff --git a/reform2-lpc-fw/src/boards/reform2/board_reform2.c b/reform2-lpc-fw/src/boards/reform2/board_reform2.c
@@ -782,6 +782,21 @@ void handle_commands() {
uartSend((uint8_t*)uartBuffer, strlen(uartBuffer));
}
+ else if (remote_cmd == 'f') {
+ // print the firmware string
+ if (cmd_number == 1) {
+ sprintf(uartBuffer,FW_STRING1"\r\n");
+ } else if (cmd_number == 2) {
+ sprintf(uartBuffer,FW_STRING2"\r\n");
+ } else if (cmd_number == 3) {
+ sprintf(uartBuffer,FW_STRING3"\r\n");
+ } else {
+ // if cmd_number is 0, print all of them concatenated as it is
+ // done for "s"
+ sprintf(uartBuffer,FW_REV"\r\n");
+ }
+ uartSend((uint8_t*)uartBuffer, strlen(uartBuffer));
+ }
else if (remote_cmd == 'u') {
// turn reporting to i.MX on or off
if (cmd_number>0) {
@@ -854,6 +869,11 @@ void handle_commands() {
som_is_powered);
uartSend((uint8_t*)uartBuffer, strlen(uartBuffer));
}
+ else if (remote_cmd == 'U') {
+ // get uptime
+ sprintf(uartBuffer, "%d\r\n", cycles_uptime);
+ uartSend((uint8_t*)uartBuffer, strlen(uartBuffer));
+ }
else if (remote_cmd == 'S') {
// get charger system cycles in current state
sprintf(uartBuffer, "%d\r\n", cycles_in_state);