Path: blob/master/libraries/AP_DAL/AP_DAL_Airspeed.cpp
9441 views
#include "AP_DAL_Airspeed.h"1#include "AP_DAL.h"23#include <AP_Logger/AP_Logger.h>45AP_DAL_Airspeed::AP_DAL_Airspeed()6{7#if AP_AIRSPEED_ENABLED8for (uint8_t i=0; i<ARRAY_SIZE(_RASI); i++) {9_RASI[i].instance = i;10}11#endif12}1314void AP_DAL_Airspeed::start_frame()15{16#if AP_AIRSPEED_ENABLED17const auto *airspeed = AP::airspeed();18if (airspeed == nullptr) {19return;20}2122const log_RASH old = _RASH;23_RASH.num_sensors = airspeed->get_num_sensors();24_RASH.primary = airspeed->get_primary();25WRITE_REPLAY_BLOCK_IFCHANGED(RASH, _RASH, old);2627for (uint8_t i=0; i<ARRAY_SIZE(_RASI); i++) {28log_RASI &RASI = _RASI[i];29log_RASI old_RASI = RASI;30RASI.last_update_ms = airspeed->last_update_ms(i);31RASI.healthy = airspeed->healthy(i);32RASI.use = airspeed->use(i);33RASI.airspeed = airspeed->get_airspeed(i);34WRITE_REPLAY_BLOCK_IFCHANGED(RASI, RASI, old_RASI);35}36#endif37}383940