From 8e582b416966b52783b82803464e71d4486c6a6a Mon Sep 17 00:00:00 2001 From: Jason Short Date: Mon, 28 Nov 2011 10:26:36 -0800 Subject: [PATCH] Logging input to find this freeze bug --- ArduCopter/Log.pde | 42 ++++++++++++++++-------------------------- 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/ArduCopter/Log.pde b/ArduCopter/Log.pde index 31a7a9fd57..b88c1da507 100644 --- a/ArduCopter/Log.pde +++ b/ArduCopter/Log.pde @@ -724,30 +724,20 @@ static void Log_Write_Control_Tuning() DataFlash.WriteByte(HEAD_BYTE2); DataFlash.WriteByte(LOG_CONTROL_TUNING_MSG); - // yaw - DataFlash.WriteInt(dcm.yaw_sensor/100); //1 - DataFlash.WriteInt(nav_yaw/100); //2 - DataFlash.WriteInt(yaw_error/100); //3 - - // Alt hold - DataFlash.WriteInt(sonar_alt); //4 - DataFlash.WriteInt(baro_alt); //5 - DataFlash.WriteInt(next_WP.alt); //6 - - DataFlash.WriteInt(nav_throttle); //7 - DataFlash.WriteInt(angle_boost); //8 - DataFlash.WriteInt(manual_boost); //9 - DataFlash.WriteInt(climb_rate); //10 - -#if HIL_MODE == HIL_MODE_ATTITUDE - DataFlash.WriteInt(0); //11 -#else - DataFlash.WriteInt((int)(barometer.RawPress - barometer._offset_press));//11 -#endif - - DataFlash.WriteInt(g.rc_3.servo_out); //12 - DataFlash.WriteInt(g.pi_alt_hold.get_integrator()); //13 - DataFlash.WriteInt(g.pi_throttle.get_integrator()); //14 + DataFlash.WriteInt(g.rc_1.control_in); // 0 + DataFlash.WriteInt(g.rc_2.control_in); // 1 + DataFlash.WriteInt(g.rc_3.control_in); // 2 + DataFlash.WriteInt(g.rc_4.control_in); // 3 + DataFlash.WriteInt(sonar_alt); // 4 + DataFlash.WriteInt(baro_alt); // 5 + DataFlash.WriteInt(next_WP.alt); // 6 + DataFlash.WriteInt(nav_throttle); // 7 + DataFlash.WriteInt(angle_boost); // 8 + DataFlash.WriteInt(manual_boost); // 9 + DataFlash.WriteInt(climb_rate); // 10 + DataFlash.WriteInt(g.rc_3.servo_out); // 11 + DataFlash.WriteInt(g.pi_alt_hold.get_integrator()); // 12 + DataFlash.WriteInt(g.pi_throttle.get_integrator()); // 13 DataFlash.WriteByte(END_BYTE); } @@ -759,11 +749,11 @@ static void Log_Read_Control_Tuning() Serial.printf_P(PSTR("CTUN, ")); - for(int8_t i = 1; i < 14; i++ ){ + for(int8_t i = 0; i < 13; i++ ){ temp = DataFlash.ReadInt(); Serial.printf("%d, ", temp); } - + // read 13 temp = DataFlash.ReadInt(); Serial.printf("%d\n", temp); }