mirror of https://github.com/ArduPilot/ardupilot
AP_ExternalAHRS: avoid uart owner issue
ensure we own uart before read
This commit is contained in:
parent
da1066124e
commit
2842166b06
|
@ -156,6 +156,8 @@ bool AP_ExternalAHRS_InertialLabs::check_uart()
|
|||
if (!setup_complete) {
|
||||
return false;
|
||||
}
|
||||
// ensure we own the uart
|
||||
uart->begin(0);
|
||||
uint32_t n = uart->available();
|
||||
if (n == 0) {
|
||||
return false;
|
||||
|
|
|
@ -208,6 +208,8 @@ bool AP_ExternalAHRS_VectorNav::check_uart()
|
|||
return false;
|
||||
}
|
||||
WITH_SEMAPHORE(state.sem);
|
||||
// ensure we own the uart
|
||||
uart->begin(0);
|
||||
uint32_t n = uart->available();
|
||||
if (n == 0) {
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue