mirror of
https://github.com/alexhopeoconnor/firmware.git
synced 2026-10-19 18:01:30 +10:00
add a .clang-format file (#9154)
This commit is contained in:
@@ -12,42 +12,40 @@
|
||||
#include <typeinfo>
|
||||
|
||||
// Singleton wrapper for the Adafruit_BMP3XX class
|
||||
class BMP3XXSingleton : public Adafruit_BMP3XX
|
||||
{
|
||||
private:
|
||||
static BMP3XXSingleton *pinstance;
|
||||
class BMP3XXSingleton : public Adafruit_BMP3XX {
|
||||
private:
|
||||
static BMP3XXSingleton *pinstance;
|
||||
|
||||
protected:
|
||||
BMP3XXSingleton();
|
||||
~BMP3XXSingleton();
|
||||
protected:
|
||||
BMP3XXSingleton();
|
||||
~BMP3XXSingleton();
|
||||
|
||||
public:
|
||||
// Create a singleton instance (not thread safe)
|
||||
static BMP3XXSingleton *GetInstance();
|
||||
public:
|
||||
// Create a singleton instance (not thread safe)
|
||||
static BMP3XXSingleton *GetInstance();
|
||||
|
||||
// Singletons should not be cloneable.
|
||||
BMP3XXSingleton(BMP3XXSingleton &other) = delete;
|
||||
// Singletons should not be cloneable.
|
||||
BMP3XXSingleton(BMP3XXSingleton &other) = delete;
|
||||
|
||||
// Singletons should not be assignable.
|
||||
void operator=(const BMP3XXSingleton &) = delete;
|
||||
// Singletons should not be assignable.
|
||||
void operator=(const BMP3XXSingleton &) = delete;
|
||||
|
||||
// Performs a full reading of all sensors in the BMP3XX. Assigns
|
||||
// the internal temperature, pressure and altitudeAmsl variables
|
||||
bool performReading();
|
||||
// Performs a full reading of all sensors in the BMP3XX. Assigns
|
||||
// the internal temperature, pressure and altitudeAmsl variables
|
||||
bool performReading();
|
||||
|
||||
// Altitude in metres above mean sea level, assigned after calling performReading()
|
||||
double altitudeAmslMetres = 0.0f;
|
||||
// Altitude in metres above mean sea level, assigned after calling performReading()
|
||||
double altitudeAmslMetres = 0.0f;
|
||||
};
|
||||
|
||||
class BMP3XXSensor : public TelemetrySensor
|
||||
{
|
||||
protected:
|
||||
BMP3XXSingleton *bmp3xx = nullptr;
|
||||
class BMP3XXSensor : public TelemetrySensor {
|
||||
protected:
|
||||
BMP3XXSingleton *bmp3xx = nullptr;
|
||||
|
||||
public:
|
||||
BMP3XXSensor();
|
||||
virtual bool getMetrics(meshtastic_Telemetry *measurement) override;
|
||||
virtual bool initDevice(TwoWire *bus, ScanI2C::FoundDevice *dev) override;
|
||||
public:
|
||||
BMP3XXSensor();
|
||||
virtual bool getMetrics(meshtastic_Telemetry *measurement) override;
|
||||
virtual bool initDevice(TwoWire *bus, ScanI2C::FoundDevice *dev) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user