AP_Baro: fix example output

PX4 boards can only start console after USB is connected so we need to
check it is available
This commit is contained in:
Francisco Ferreira 2017-03-04 02:35:43 +00:00 committed by Randy Mackay
parent 4a3917a349
commit f6687a2d6c
1 changed files with 4 additions and 0 deletions

View File

@ -32,6 +32,10 @@ void setup()
void loop()
{
if (!hal.console->is_initialized()) {
return;
}
// run accumulate() at 50Hz and update() at 10Hz
if ((AP_HAL::micros() - timer) > 20 * 1000UL) {
timer = AP_HAL::micros();