Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
co2ampel
ampel-firmware
Commits
90d94b88
Commit
90d94b88
authored
Apr 18, 2021
by
Eric Duminil
Browse files
Allow backspace in console
parent
b912c9e4
Pipeline
#2825
passed with stage
in 1 minute and 41 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ampel-firmware/sensor_commands.cpp
View file @
90d94b88
...
...
@@ -92,10 +92,16 @@ namespace sensor_commands {
break
;
case
'\r'
:
// discard carriage return
break
;
case
'\b'
:
// backspace
if
(
input_pos
>
0
)
{
input_pos
--
;
}
break
;
default:
// keep adding if not full ... allow for terminating null byte
if
(
input_pos
<
(
MAX_COMMAND_SIZE
-
1
))
if
(
input_pos
<
(
MAX_COMMAND_SIZE
-
1
))
{
input_line
[
input_pos
++
]
=
input_byte
;
}
break
;
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment