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:
Julien BERAUD 2015-07-31 18:27:03 +02:00 committed by Randy Mackay
parent de7cf019ef
commit 407bb5933b

View File

@ -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);