diff --git a/lib/uuid-console/src/shell.cpp b/lib/uuid-console/src/shell.cpp index d57c004f0..7156bddfd 100644 --- a/lib/uuid-console/src/shell.cpp +++ b/lib/uuid-console/src/shell.cpp @@ -213,7 +213,7 @@ void Shell::loop_normal() { default: if (esc_) { - if (c == '[') { + if ((c == '[') || (c == 'O')) { // start of sequence } else if (c >= '0' && (c <= '9')) { // numbers @@ -240,6 +240,22 @@ void Shell::loop_normal() { cursor_++; } esc_ = 0; + } else if (c == 'H') { + // Home + cursor_ = line_buffer_.length(); + esc_ = 0; + } else if (c == 'F') { + // End + cursor_ = 0; + esc_ = 0; + } else if (c == 'P') { + // F1 + set_command_str(F("help")); + esc_ = 0; + } else if (c == 'Q') { + // F2 + set_command_str(F("show")); + esc_ = 0; } else if (c == '~') { // function keys with number if ((esc_ == 3) && cursor_) { @@ -262,8 +278,8 @@ void Shell::loop_normal() { // F9 line_buffer_ = read_flash_string(F("send telegram \"0B \"")); cursor_ = 1; - } else if (esc_ == 21) { - // F10 + } else if (esc_ == 15) { + // F5 set_command_str(F("call system report")); } esc_ = 0; diff --git a/src/helpers.cpp b/src/helpers.cpp index 328b69d71..c63831402 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -140,18 +140,14 @@ char * Helpers::render_enum(char * result, const std::vector= value.size()) { return nullptr; // out of bounds } - std::string str = uuid::read_flash_string(value[no]); - if (bool_format() == BOOL_FORMAT_ONOFF) { - strcpy(result, str.c_str()); - } else if (bool_format() == BOOL_FORMAT_TRUEFALSE) { + strcpy(result, uuid::read_flash_string(value[no]).c_str()); + if (bool_format() == BOOL_FORMAT_TRUEFALSE) { if (no == 0 && uuid::read_flash_string(value[0]) == "off") { strlcpy(result, "false", 7); } else if (no == 1 && uuid::read_flash_string(value[1]) == "on") { strlcpy(result, "true", 6); - } else { - strcpy(result, str.c_str()); } - } else { + } else if (bool_format() == BOOL_FORMAT_NUMBERS) { itoa(result, no); } return result; diff --git a/src/helpers.h b/src/helpers.h index ce4cdd584..8573d5797 100644 --- a/src/helpers.h +++ b/src/helpers.h @@ -26,6 +26,7 @@ #define BOOL_FORMAT_ONOFF 1 #define BOOL_FORMAT_TRUEFALSE 2 +#define BOOL_FORMAT_NUMBERS 3 namespace emsesp {