AP_Airspeed: use millis/micros/panic functions

This commit is contained in:
Caio Marcelo de Oliveira Filho 2015-11-20 12:07:00 +09:00 committed by Randy Mackay
parent 3a17c858e3
commit 2b10e0fac0
2 changed files with 7 additions and 7 deletions

View File

@ -236,7 +236,7 @@ void AP_Airspeed::read(void)
_last_pressure = airspeed_pressure;
_raw_airspeed = sqrtf(airspeed_pressure * _ratio);
_airspeed = 0.7f * _airspeed + 0.3f * _raw_airspeed;
_last_update_ms = hal.scheduler->millis();
_last_update_ms = AP_HAL::millis();
}
void AP_Airspeed::setHIL(float airspeed, float diff_pressure, float temperature)
@ -244,7 +244,7 @@ void AP_Airspeed::setHIL(float airspeed, float diff_pressure, float temperature)
_raw_airspeed = airspeed;
_airspeed = airspeed;
_last_pressure = diff_pressure;
_last_update_ms = hal.scheduler->millis();
_last_update_ms = AP_HAL::millis();
_hil_pressure = diff_pressure;
_hil_set = true;
_healthy = true;

View File

@ -54,7 +54,7 @@ void AP_Airspeed_I2C::_measure(void)
{
_measurement_started_ms = 0;
if (hal.i2c->writeRegisters(I2C_ADDRESS_MS4525DO, 0, 0, NULL) == 0) {
_measurement_started_ms = hal.scheduler->millis();
_measurement_started_ms = AP_HAL::millis();
}
}
@ -98,7 +98,7 @@ void AP_Airspeed_I2C::_collect(void)
_pressure = diff_press_PSI * PSI_to_Pa;
_temperature = ((200.0f * dT_raw) / 2047) - 50;
_last_sample_time_ms = hal.scheduler->millis();
_last_sample_time_ms = AP_HAL::millis();
}
// 1kHz timer
@ -114,7 +114,7 @@ void AP_Airspeed_I2C::_timer(void)
i2c_sem->give();
return;
}
if ((hal.scheduler->millis() - _measurement_started_ms) > 10) {
if ((AP_HAL::millis() - _measurement_started_ms) > 10) {
_collect();
// start a new measurement
_measure();
@ -125,7 +125,7 @@ void AP_Airspeed_I2C::_timer(void)
// return the current differential_pressure in Pascal
bool AP_Airspeed_I2C::get_differential_pressure(float &pressure)
{
if ((hal.scheduler->millis() - _last_sample_time_ms) > 100) {
if ((AP_HAL::millis() - _last_sample_time_ms) > 100) {
return false;
}
pressure = _pressure;
@ -135,7 +135,7 @@ bool AP_Airspeed_I2C::get_differential_pressure(float &pressure)
// return the current temperature in degrees C, if available
bool AP_Airspeed_I2C::get_temperature(float &temperature)
{
if ((hal.scheduler->millis() - _last_sample_time_ms) > 100) {
if ((AP_HAL::millis() - _last_sample_time_ms) > 100) {
return false;
}
temperature = _temperature;