AP_HAL: add delay to UART_test example

For AC3.5 and higher version, serial uartA-USBconsole cannot work. Maybe the code before "setup" has been changed. Ensure that the uartA can be initialized
This commit is contained in:
Chinese66 2017-11-22 00:35:52 +08:00 committed by Randy Mackay
parent 279a57dc10
commit 700aaf2e8f

View File

@ -30,7 +30,10 @@ void setup(void)
{ {
/* /*
start all UARTs at 57600 with default buffer sizes start all UARTs at 57600 with default buffer sizes
*/ */
hal.scheduler->delay(1000); //Ensure that the uartA can be initialized
setup_uart(hal.uartA, "uartA"); // console setup_uart(hal.uartA, "uartA"); // console
setup_uart(hal.uartB, "uartB"); // 1st GPS setup_uart(hal.uartB, "uartB"); // 1st GPS
setup_uart(hal.uartC, "uartC"); // telemetry 1 setup_uart(hal.uartC, "uartC"); // telemetry 1