43 static uint8_t buffer_len = 0;
45 static uint8_t cli_line_pool_write = 0;
48 uint32_t processed_chars = 0U;
50 (input_char = getchar_timeout_us(0)) != PICO_ERROR_TIMEOUT)
54 if (input_char ==
'\n' || input_char ==
'\r')
58 line_buffer[buffer_len] =
'\0';
60 char* line_slot = cli_line_pool[cli_line_pool_write];
64 LOG_ERROR(
"Failed to format CLI line\r\n");
70 LOG_ERROR(
"CLI line truncated (len=%d)\r\n", written);
87 LOG_ERROR(
"Event queue full, dropping line\r\n");
102 if (buffer_len <
sizeof(line_buffer) - 1)
106 line_buffer[buffer_len++] = (char)input_char;
111 LOG_DEBUG(
"[DEBUG] Ignoring char: 0x%02X\r\n", input_char);