mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-23 00:04:02 -04:00
ArduCopter: only attempt to change settings of optical flow sensor if it has been successfully initialised
This commit is contained in:
parent
af77425636
commit
52177c63f7
@ -54,7 +54,7 @@ static void init_optflow()
|
|||||||
if( optflow.init(false, &timer_scheduler, &spi_semaphore, &spi3_semaphore) == false ) {
|
if( optflow.init(false, &timer_scheduler, &spi_semaphore, &spi3_semaphore) == false ) {
|
||||||
g.optflow_enabled = false;
|
g.optflow_enabled = false;
|
||||||
cliSerial->print_P(PSTR("\nFailed to Init OptFlow "));
|
cliSerial->print_P(PSTR("\nFailed to Init OptFlow "));
|
||||||
}
|
}else{
|
||||||
// suspend timer while we set-up SPI communication
|
// suspend timer while we set-up SPI communication
|
||||||
timer_scheduler.suspend_timer();
|
timer_scheduler.suspend_timer();
|
||||||
|
|
||||||
@ -65,6 +65,7 @@ static void init_optflow()
|
|||||||
|
|
||||||
// resume timer
|
// resume timer
|
||||||
timer_scheduler.resume_timer();
|
timer_scheduler.resume_timer();
|
||||||
|
}
|
||||||
#endif // OPTFLOW == ENABLED
|
#endif // OPTFLOW == ENABLED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user