Compass heading added to ATT log

This commit is contained in:
Jason Short 2012-02-24 12:10:58 -08:00
parent 06be0d24ba
commit ab945f36df
1 changed files with 7 additions and 3 deletions

View File

@ -701,6 +701,7 @@ static void Log_Write_Attitude()
DataFlash.WriteInt((int)dcm.pitch_sensor); // 4 DataFlash.WriteInt((int)dcm.pitch_sensor); // 4
DataFlash.WriteInt(g.rc_4.control_in); // 5 DataFlash.WriteInt(g.rc_4.control_in); // 5
DataFlash.WriteInt((uint16_t)dcm.yaw_sensor); // 6 DataFlash.WriteInt((uint16_t)dcm.yaw_sensor); // 6
DataFlash.WriteInt((uint16_t)compass.heading); // 6
DataFlash.WriteByte(END_BYTE); DataFlash.WriteByte(END_BYTE);
} }
@ -714,15 +715,18 @@ static void Log_Read_Attitude()
int16_t temp4 = DataFlash.ReadInt(); int16_t temp4 = DataFlash.ReadInt();
int16_t temp5 = DataFlash.ReadInt(); int16_t temp5 = DataFlash.ReadInt();
uint16_t temp6 = DataFlash.ReadInt(); uint16_t temp6 = DataFlash.ReadInt();
uint16_t temp7 = DataFlash.ReadInt();
temp7 = wrap_360(temp7);
// 1 2 3 4 5 6 // 1 2 3 4 5 6 7
Serial.printf_P(PSTR("ATT, %d, %d, %d, %d, %d, %u\n"), Serial.printf_P(PSTR("ATT, %d, %d, %d, %d, %d, %u, %u\n"),
temp1, temp1,
temp2, temp2,
temp3, temp3,
temp4, temp4,
temp5, temp5,
temp6); temp6,
temp7);
} }
// Write a mode packet. Total length : 7 bytes // Write a mode packet. Total length : 7 bytes