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)); _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';