AP_Menu: be friendly to multi-tasking OSes in menus

This commit is contained in:
Andrew Tridgell 2013-10-01 13:04:40 +10:00
parent 2819dd99fa
commit 134bf5a5c9
1 changed files with 3 additions and 1 deletions

View File

@ -58,8 +58,10 @@ Menu::run(void)
_port->printf_P(PSTR("%S] "), FPSTR(_prompt));
for (;; ) {
c = _port->read();
if (-1 == c)
if (-1 == c) {
hal.scheduler->delay(20);
continue;
}
// carriage return -> process command
if ('\r' == c || '\n' == c) {
_inbuf[len] = '\0';