mirror of https://github.com/ArduPilot/ardupilot
AP_Menu: be friendly to multi-tasking OSes in menus
This commit is contained in:
parent
2819dd99fa
commit
134bf5a5c9
|
@ -58,8 +58,10 @@ Menu::run(void)
|
||||||
_port->printf_P(PSTR("%S] "), FPSTR(_prompt));
|
_port->printf_P(PSTR("%S] "), FPSTR(_prompt));
|
||||||
for (;; ) {
|
for (;; ) {
|
||||||
c = _port->read();
|
c = _port->read();
|
||||||
if (-1 == c)
|
if (-1 == c) {
|
||||||
|
hal.scheduler->delay(20);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
// carriage return -> process command
|
// carriage return -> process command
|
||||||
if ('\r' == c || '\n' == c) {
|
if ('\r' == c || '\n' == c) {
|
||||||
_inbuf[len] = '\0';
|
_inbuf[len] = '\0';
|
||||||
|
|
Loading…
Reference in New Issue