diff --git a/README.md b/README.md index bb232a8..4cb9f31 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ TODO: add caninstall and canstart canup/caninstall parameters (without filtering) add filtering (software and hardware) - add tec/rec counter better alarms handling, can recovering better history clear history and clear screen commands diff --git a/main/console.c b/main/console.c index cc5fd5f..382a455 100644 --- a/main/console.c +++ b/main/console.c @@ -29,14 +29,14 @@ static const bool use_colors = true; #endif static const char* TAG = "console task"; -char prompt_buf[40]; +char prompt_buf[60]; esp_console_config_t console_config; struct linenoiseState ls; SemaphoreHandle_t console_taken_sem; static void update_prompt() { - char text[30]; + char text[45]; int text_len; static char* prompt_color; text[0] = '\0'; @@ -66,6 +66,11 @@ static void update_prompt() { prompt_color = LOG_COLOR(LOG_COLOR_RED); break; } + if (curr_can_state.state != CAN_NOT_INSTALLED) { + char tec_rec[25]; + snprintf(tec_rec, 24, " [TEC: %" PRIu32 "][REC: %" PRIu32 "]", curr_can_state.tx_error_counter, curr_can_state.rx_error_counter); + strcat(text, tec_rec); + } strcat(text, " > "); prompt_buf[0] = '\0'; if (use_colors) {