mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-26 01:33:56 -04:00
AP_Baro: added dummy driver
useful for board bringup
This commit is contained in:
parent
f7a65afa67
commit
4d24aa43db
@ -42,6 +42,7 @@
|
||||
#include "AP_Baro_FBM320.h"
|
||||
#include "AP_Baro_DPS280.h"
|
||||
#include "AP_Baro_BMP388.h"
|
||||
#include "AP_Baro_Dummy.h"
|
||||
#if HAL_WITH_UAVCAN
|
||||
#include "AP_Baro_UAVCAN.h"
|
||||
#endif
|
||||
|
13
libraries/AP_Baro/AP_Baro_Dummy.cpp
Normal file
13
libraries/AP_Baro/AP_Baro_Dummy.cpp
Normal file
@ -0,0 +1,13 @@
|
||||
#include "AP_Baro_Dummy.h"
|
||||
|
||||
AP_Baro_Dummy::AP_Baro_Dummy(AP_Baro &baro) :
|
||||
AP_Baro_Backend(baro)
|
||||
{
|
||||
_instance = _frontend.register_sensor();
|
||||
}
|
||||
|
||||
// Read the sensor
|
||||
void AP_Baro_Dummy::update(void)
|
||||
{
|
||||
_copy_to_frontend(0, 91300, 21);
|
||||
}
|
20
libraries/AP_Baro/AP_Baro_Dummy.h
Normal file
20
libraries/AP_Baro/AP_Baro_Dummy.h
Normal file
@ -0,0 +1,20 @@
|
||||
/*
|
||||
dummy backend barometer. Used during board bringup. Selected using
|
||||
BARO line in hwdef.dat
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "AP_Baro_Backend.h"
|
||||
|
||||
class AP_Baro_Dummy : public AP_Baro_Backend
|
||||
{
|
||||
public:
|
||||
AP_Baro_Dummy(AP_Baro &baro);
|
||||
void update(void) override;
|
||||
static AP_Baro_Backend *probe(AP_Baro &baro) {
|
||||
return new AP_Baro_Dummy(baro);
|
||||
}
|
||||
|
||||
private:
|
||||
uint8_t _instance;
|
||||
};
|
Loading…
Reference in New Issue
Block a user