AP_UAVCAN: use new UARTDriver discard_input method

This commit is contained in:
Peter Barker 2020-05-23 10:24:33 +10:00 committed by Andrew Tridgell
parent 95f9769041
commit 90038339dc

View File

@ -294,14 +294,10 @@ void loop(void)
// auto-reboot for --upload
if (hal.console->available() > 50) {
hal.console->printf("rebooting\n");
while (hal.console->available()) {
hal.console->read();
}
hal.console->discard_input();
hal.scheduler->reboot(false);
}
while (hal.console->available()) {
hal.console->read();
}
hal.console->discard_input();
}
AP_HAL_MAIN();