Commit 8dfc9f69 authored by Eric Duminil's avatar Eric Duminil
Browse files

Adding console output while typing

parent 08d9755a
Pipeline #2836 passed with stage
in 1 minute and 37 seconds
......@@ -86,6 +86,7 @@ namespace sensor_console {
static unsigned int input_pos = 0;
switch (input_byte) {
case '\n': // end of text
Serial.println();
input_line[input_pos] = 0;
runCommand(input_line);
input_pos = 0;
......@@ -95,12 +96,17 @@ namespace sensor_console {
case '\b': // backspace
if (input_pos > 0) {
input_pos--;
Serial.print(F("\b \b"));
}
break;
default:
if (input_pos == 0) {
Serial.print(F("> "));
}
// keep adding if not full ... allow for terminating null byte
if (input_pos < (MAX_COMMAND_SIZE - 1)) {
input_line[input_pos++] = input_byte;
Serial.print((char) input_byte);
}
break;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment