diff --git a/ArduPlane/ArduPlane.pde b/ArduPlane/ArduPlane.pde index 42dfe7e6c2..524fc766f0 100644 --- a/ArduPlane/ArduPlane.pde +++ b/ArduPlane/ArduPlane.pde @@ -452,7 +452,7 @@ static int pmTest1 = 0; static unsigned long fast_loopTimer; // Time in miliseconds of main control loop static unsigned long fast_loopTimeStamp; // Time Stamp when fast loop was complete static uint8_t delta_ms_fast_loop; // Delta Time in miliseconds -static int mainLoop_count; +static uint16_t mainLoop_count; static unsigned long medium_loopTimer; // Time in miliseconds of medium loop static byte medium_loopCounter; // Counters for branching from main control loop to slower loops diff --git a/ArduPlane/Log.pde b/ArduPlane/Log.pde index 70ad616c07..ab2df904e7 100644 --- a/ArduPlane/Log.pde +++ b/ArduPlane/Log.pde @@ -455,7 +455,7 @@ static void Log_Write_Performance() DataFlash.WriteByte(HEAD_BYTE2); DataFlash.WriteByte(LOG_PERFORMANCE_MSG); DataFlash.WriteLong(millis()- perf_mon_timer); - DataFlash.WriteInt(mainLoop_count); + DataFlash.WriteInt((int16_t)mainLoop_count); DataFlash.WriteInt(G_Dt_max); DataFlash.WriteByte(dcm.gyro_sat_count); DataFlash.WriteByte(imu.adc_constraints);