mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-28 12:42:00 +00:00
add a .clang-format file (#9154)
This commit is contained in:
@@ -17,45 +17,43 @@
|
||||
extern ScanI2C::DeviceAddress accelerometer_found;
|
||||
|
||||
// Singleton wrapper for the Sparkfun QMA_6100P_I2C class
|
||||
class QMA6100PSingleton : public QMA6100P
|
||||
{
|
||||
private:
|
||||
static QMA6100PSingleton *pinstance;
|
||||
class QMA6100PSingleton : public QMA6100P {
|
||||
private:
|
||||
static QMA6100PSingleton *pinstance;
|
||||
|
||||
protected:
|
||||
QMA6100PSingleton();
|
||||
~QMA6100PSingleton();
|
||||
protected:
|
||||
QMA6100PSingleton();
|
||||
~QMA6100PSingleton();
|
||||
|
||||
public:
|
||||
// Create a singleton instance (not thread safe)
|
||||
static QMA6100PSingleton *GetInstance();
|
||||
public:
|
||||
// Create a singleton instance (not thread safe)
|
||||
static QMA6100PSingleton *GetInstance();
|
||||
|
||||
// Singletons should not be cloneable.
|
||||
QMA6100PSingleton(QMA6100PSingleton &other) = delete;
|
||||
// Singletons should not be cloneable.
|
||||
QMA6100PSingleton(QMA6100PSingleton &other) = delete;
|
||||
|
||||
// Singletons should not be assignable.
|
||||
void operator=(const QMA6100PSingleton &) = delete;
|
||||
// Singletons should not be assignable.
|
||||
void operator=(const QMA6100PSingleton &) = delete;
|
||||
|
||||
// Initialise the motion sensor singleton for normal operation
|
||||
bool init(ScanI2C::FoundDevice device);
|
||||
// Initialise the motion sensor singleton for normal operation
|
||||
bool init(ScanI2C::FoundDevice device);
|
||||
|
||||
// Enable Wake on Motion interrupts (sensor must be initialised first)
|
||||
bool setWakeOnMotion();
|
||||
// Enable Wake on Motion interrupts (sensor must be initialised first)
|
||||
bool setWakeOnMotion();
|
||||
};
|
||||
|
||||
class QMA6100PSensor : public MotionSensor
|
||||
{
|
||||
private:
|
||||
QMA6100PSingleton *sensor = nullptr;
|
||||
class QMA6100PSensor : public MotionSensor {
|
||||
private:
|
||||
QMA6100PSingleton *sensor = nullptr;
|
||||
|
||||
public:
|
||||
explicit QMA6100PSensor(ScanI2C::FoundDevice foundDevice);
|
||||
public:
|
||||
explicit QMA6100PSensor(ScanI2C::FoundDevice foundDevice);
|
||||
|
||||
// Initialise the motion sensor
|
||||
virtual bool init() override;
|
||||
// Initialise the motion sensor
|
||||
virtual bool init() override;
|
||||
|
||||
// Called each time our sensor gets a chance to run
|
||||
virtual int32_t runOnce() override;
|
||||
// Called each time our sensor gets a chance to run
|
||||
virtual int32_t runOnce() override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user