add a .clang-format file (#9154)

This commit is contained in:
Jorropo
2026-01-03 14:19:24 -06:00
committed by GitHub
parent abab6ce815
commit 0d11331d18
771 changed files with 77733 additions and 83165 deletions
+25 -27
View File
@@ -13,43 +13,41 @@
extern ScanI2C::DeviceAddress accelerometer_found;
// Singleton wrapper
class BMM150Singleton : public DFRobot_BMM150_I2C
{
private:
static BMM150Singleton *pinstance;
class BMM150Singleton : public DFRobot_BMM150_I2C {
private:
static BMM150Singleton *pinstance;
protected:
BMM150Singleton(TwoWire *tw, uint8_t addr) : DFRobot_BMM150_I2C(tw, addr) {}
~BMM150Singleton();
protected:
BMM150Singleton(TwoWire *tw, uint8_t addr) : DFRobot_BMM150_I2C(tw, addr) {}
~BMM150Singleton();
public:
// Create a singleton instance (not thread safe)
static BMM150Singleton *GetInstance(ScanI2C::FoundDevice device);
public:
// Create a singleton instance (not thread safe)
static BMM150Singleton *GetInstance(ScanI2C::FoundDevice device);
// Singletons should not be cloneable.
BMM150Singleton(BMM150Singleton &other) = delete;
// Singletons should not be cloneable.
BMM150Singleton(BMM150Singleton &other) = delete;
// Singletons should not be assignable.
void operator=(const BMM150Singleton &) = delete;
// Singletons should not be assignable.
void operator=(const BMM150Singleton &) = 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);
};
class BMM150Sensor : public MotionSensor
{
private:
BMM150Singleton *sensor = nullptr;
bool showingScreen = false;
class BMM150Sensor : public MotionSensor {
private:
BMM150Singleton *sensor = nullptr;
bool showingScreen = false;
public:
explicit BMM150Sensor(ScanI2C::FoundDevice foundDevice);
public:
explicit BMM150Sensor(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