2014-10-19 16:22:51 -03:00
|
|
|
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
|
|
|
|
2015-08-11 03:28:42 -03:00
|
|
|
#include "AP_Baro.h"
|
2014-10-19 16:22:51 -03:00
|
|
|
|
|
|
|
extern const AP_HAL::HAL& hal;
|
|
|
|
|
|
|
|
// constructor
|
|
|
|
AP_Baro_Backend::AP_Baro_Backend(AP_Baro &baro) :
|
|
|
|
_frontend(baro)
|
|
|
|
{}
|
|
|
|
|
|
|
|
/*
|
|
|
|
copy latest data to the frontend from a backend
|
|
|
|
*/
|
|
|
|
void AP_Baro_Backend::_copy_to_frontend(uint8_t instance, float pressure, float temperature)
|
|
|
|
{
|
|
|
|
if (instance >= _frontend._num_sensors) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
_frontend.sensors[instance].pressure = pressure;
|
|
|
|
_frontend.sensors[instance].temperature = temperature;
|
|
|
|
_frontend.sensors[instance].last_update_ms = hal.scheduler->millis();
|
|
|
|
}
|