mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-10 09:58:28 -04:00
AP_Compass_AK8963: suspend timer while reading
Protection in case a timer falls while reading data, because it could end up with corrupted data
This commit is contained in:
parent
de7cf019ef
commit
407bb5933b
@ -202,10 +202,11 @@ void AP_Compass_AK8963::read()
|
||||
return;
|
||||
}
|
||||
|
||||
hal.scheduler->suspend_timer_procs();
|
||||
auto field = _get_filtered_field();
|
||||
_make_factory_sensitivity_adjustment(field);
|
||||
|
||||
_reset_filter();
|
||||
hal.scheduler->resume_timer_procs();
|
||||
_make_factory_sensitivity_adjustment(field);
|
||||
|
||||
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BEBOP
|
||||
field.rotate(ROTATION_YAW_90);
|
||||
|
Loading…
Reference in New Issue
Block a user