Copter: added logging of 2nd compass

This commit is contained in:
Andrew Tridgell 2013-12-10 13:35:04 +11:00
parent beb9bffcf2
commit 5802d7f86b

View File

@ -368,6 +368,7 @@ static void Log_Write_Compass()
}; };
DataFlash.WriteBlock(&pkt, sizeof(pkt)); DataFlash.WriteBlock(&pkt, sizeof(pkt));
#if COMPASS_MAX_INSTANCES > 1 #if COMPASS_MAX_INSTANCES > 1
if (compass.get_count() > 1) {
const Vector3f &mag2_offsets = compass.get_offsets(1); const Vector3f &mag2_offsets = compass.get_offsets(1);
const Vector3f &mag2_motor_offsets = compass.get_motor_offsets(1); const Vector3f &mag2_motor_offsets = compass.get_motor_offsets(1);
const Vector3f &mag2 = compass.get_field(1); const Vector3f &mag2 = compass.get_field(1);
@ -384,6 +385,7 @@ static void Log_Write_Compass()
motor_offset_z : (int16_t)mag2_motor_offsets.z motor_offset_z : (int16_t)mag2_motor_offsets.z
}; };
DataFlash.WriteBlock(&pkt2, sizeof(pkt2)); DataFlash.WriteBlock(&pkt2, sizeof(pkt2));
}
#endif #endif
} }