mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 14:38:30 -04:00
AP_Periph: reduce Rx latency by reading while sitting in delay
This commit is contained in:
parent
e9faab288c
commit
bb65ab83be
@ -395,7 +395,7 @@ void AP_Periph_FW::update()
|
||||
#endif
|
||||
|
||||
can_update();
|
||||
hal.scheduler->delay(1);
|
||||
|
||||
#if (defined(HAL_PERIPH_NEOPIXEL_COUNT_WITHOUT_NOTIFY) && HAL_PERIPH_NEOPIXEL_COUNT_WITHOUT_NOTIFY == 8) || defined(HAL_PERIPH_ENABLE_NOTIFY)
|
||||
update_rainbow();
|
||||
#endif
|
||||
|
@ -1552,9 +1552,13 @@ void AP_Periph_FW::can_update()
|
||||
#ifdef HAL_PERIPH_ENABLE_RC_OUT
|
||||
rcout_update();
|
||||
#endif
|
||||
const uint32_t now_us = AP_HAL::micros();
|
||||
while ((AP_HAL::micros() - now_us) < 1000) {
|
||||
hal.scheduler->delay_microseconds(64);
|
||||
processTx();
|
||||
processRx();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
update CAN magnetometer
|
||||
|
Loading…
Reference in New Issue
Block a user