diff --git a/sw/airborne/avr/sys_time_hw.h b/sw/airborne/avr/sys_time_hw.h index 5a26de7d7d..3d96a60c76 100644 --- a/sw/airborne/avr/sys_time_hw.h +++ b/sw/airborne/avr/sys_time_hw.h @@ -101,7 +101,7 @@ extern volatile uint8_t tmr2_ov_cnt; extern volatile bool_t tmr2_overflow; #endif -#define TICKS_PER_SEC (CLOCK * 1e6 / 1024 * 256) +#define TICKS_PER_SEC (CLOCK * 1e6 / 1024) #if CLOCK == 8 static inline bool_t sys_time_periodic( void ) { diff --git a/sw/airborne/infrared.c b/sw/airborne/infrared.c index 0af3e6495d..deea30d5b1 100644 --- a/sw/airborne/infrared.c +++ b/sw/airborne/infrared.c @@ -198,7 +198,7 @@ uint8_t calib_status = NO_CALIB; void ground_calibrate( bool_t triggered ) { switch (calib_status) { case NO_CALIB: - if (cpu_time < MAX_DELAY_FOR_CALIBRATION && pprz_mode == PPRZ_MODE_AUTO1 ) { + if (cpu_time_sec < MAX_DELAY_FOR_CALIBRATION && pprz_mode == PPRZ_MODE_AUTO1 ) { calib_status = WAITING_CALIB_CONTRAST; DOWNLINK_SEND_CALIB_START(); } diff --git a/sw/airborne/main_ap.c b/sw/airborne/main_ap.c index c79d758554..5048f1019a 100644 --- a/sw/airborne/main_ap.c +++ b/sw/airborne/main_ap.c @@ -300,7 +300,7 @@ static void navigation_task( void ) { static uint8_t last_pprz_mode; /** Test if we lost the GPS */ if (!GpsFixValid() || - (cpu_time - last_gps_msg_t > FAILSAFE_DELAY_WITHOUT_GPS)) { + (cpu_time_sec - last_gps_msg_t > FAILSAFE_DELAY_WITHOUT_GPS)) { /** If aircraft is launch and is in autonomus mode, go into PPRZ_MODE_GPS_OUT_OF_ORDER mode (Failsafe). */ if (launch && (pprz_mode == PPRZ_MODE_AUTO2 || @@ -417,7 +417,7 @@ void periodic_task_ap( void ) { if (!_1Hz) { if (estimator_flight_time) estimator_flight_time++; - cpu_time++; + cpu_time_sec++; stage_time_ds = (int16_t)(stage_time_ds+.5); stage_time++; block_time++; @@ -450,7 +450,7 @@ void periodic_task_ap( void ) { estimator_hspeed_mod > MIN_SPEED_FOR_TAKEOFF) { estimator_flight_time = 1; launch = TRUE; /* Not set in non auto launch */ - DOWNLINK_SEND_TAKEOFF(&cpu_time); + DOWNLINK_SEND_TAKEOFF(&cpu_time_sec); } break;