1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

AHRS: Move getting mag data back into the main loop

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2998 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
peabody124 2011-03-07 19:28:25 +00:00 committed by peabody124
parent aea0695f70
commit b2abc73ae3

View File

@ -623,7 +623,10 @@ for all data to be up to date before doing anything*/
// This function blocks till data avilable
get_accel_gyro_data();
// Get any mag data available
process_mag_data();
counter_val = timer_count();
idle_counts = counter_val - last_counter_idle_start;
last_counter_idle_end = counter_val;
@ -675,7 +678,6 @@ bool get_accel_gyro_data()
while(fifoBuf_getUsed(&adc_fifo_buffer) < (sizeof(accel) + sizeof(gyro))) {
if(spin_count++ == 0)
AhrsPoll();
process_mag_data();
}
fifoBuf_getData(&adc_fifo_buffer, &accel[0], sizeof(float) * 3);