From 395c8687270b4bc777883c30a6af83ef0e82c08b Mon Sep 17 00:00:00 2001 From: Robert Lefebvre Date: Fri, 16 Jan 2015 17:34:44 -0500 Subject: [PATCH] Plane: Change Compass logging to new DataFlash method that handles instances. --- ArduPlane/ArduPlane.pde | 2 +- ArduPlane/Log.pde | 18 ------------------ 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/ArduPlane/ArduPlane.pde b/ArduPlane/ArduPlane.pde index 4343eb5de1..34d6312270 100644 --- a/ArduPlane/ArduPlane.pde +++ b/ArduPlane/ArduPlane.pde @@ -936,7 +936,7 @@ static void update_compass(void) ahrs.set_compass(&compass); compass.learn_offsets(); if (should_log(MASK_LOG_COMPASS)) { - Log_Write_Compass(); + DataFlash.Log_Write_Compass(compass); } } else { ahrs.set_compass(NULL); diff --git a/ArduPlane/Log.pde b/ArduPlane/Log.pde index 0ae1fd2599..2ca87db635 100644 --- a/ArduPlane/Log.pde +++ b/ArduPlane/Log.pde @@ -403,23 +403,6 @@ static void Log_Arm_Disarm() { DataFlash.WriteBlock(&pkt, sizeof(pkt)); } -// Write a Compass packet -static void Log_Write_Compass() -{ - DataFlash.Log_Write_Compass(compass, 0); - -#if COMPASS_MAX_INSTANCES > 1 - if (compass.get_count() > 1) { - DataFlash.Log_Write_Compass(compass, 1); - } -#endif -#if COMPASS_MAX_INSTANCES > 2 - if (compass.get_count() > 2) { - DataFlash.Log_Write_Compass(compass, 2); - } -#endif -} - static void Log_Write_GPS(uint8_t instance) { DataFlash.Log_Write_GPS(gps, instance, current_loc.alt - ahrs.get_home().alt); @@ -512,7 +495,6 @@ static void Log_Write_Cmd(const AP_Mission::Mission_Command &cmd) {} static void Log_Write_Attitude() {} static void Log_Write_Control_Tuning() {} static void Log_Write_Mode(uint8_t mode) {} -static void Log_Write_Compass() {} static void Log_Write_GPS(uint8_t instance) {} static void Log_Write_IMU() {} static void Log_Write_RC() {}