mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-08 17:08:28 -04:00
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
Block a user