Usermod class vars pt2: enabled default value
This commit is contained in:
@@ -159,7 +159,7 @@ class UsermodTemperature : public Usermod {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UsermodTemperature(const char *name):Usermod(name) {} //WLEDMM: this shouldn't be necessary (passthrough of constructor), maybe because Usermod is an abstract class
|
UsermodTemperature(const char *name, bool enabled):Usermod(name, enabled) {} //WLEDMM: this shouldn't be necessary (passthrough of constructor), maybe because Usermod is an abstract class
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
int retries = 10;
|
int retries = 10;
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ class MPU6050Driver : public Usermod {
|
|||||||
static const char _INT_pin[];
|
static const char _INT_pin[];
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MPU6050Driver(const char *name):Usermod(name) {} //WLEDMM: this shouldn't be necessary (passthrough of constructor), maybe because Usermod is an abstract class
|
MPU6050Driver(const char *name, bool enabled):Usermod(name, enabled) {} //WLEDMM: this shouldn't be necessary (passthrough of constructor), maybe because Usermod is an abstract class
|
||||||
|
|
||||||
bool dmpReady = false; // set true if DMP init was successful // WLEDMM expose this info in public interface
|
bool dmpReady = false; // set true if DMP init was successful // WLEDMM expose this info in public interface
|
||||||
// orientation/motion vars
|
// orientation/motion vars
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ class Usermod {
|
|||||||
bool enabled = false; //WLEDMM
|
bool enabled = false; //WLEDMM
|
||||||
const char *_name; //WLEDMM
|
const char *_name; //WLEDMM
|
||||||
public:
|
public:
|
||||||
Usermod(const char *name = nullptr) { um_data = nullptr; _name = name;}
|
Usermod(const char *_name = nullptr, bool enabled=false) { um_data = nullptr; this->_name = _name; this->enabled=enabled;}
|
||||||
virtual ~Usermod() { if (um_data) delete um_data; }
|
virtual ~Usermod() { if (um_data) delete um_data; }
|
||||||
virtual void setup() = 0; // pure virtual, has to be overriden
|
virtual void setup() = 0; // pure virtual, has to be overriden
|
||||||
virtual void loop() = 0; // pure virtual, has to be overriden
|
virtual void loop() = 0; // pure virtual, has to be overriden
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ void registerUsermods()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USERMOD_DALLASTEMPERATURE
|
#ifdef USERMOD_DALLASTEMPERATURE
|
||||||
usermods.add(new UsermodTemperature("Temperature"));
|
usermods.add(new UsermodTemperature("Temperature", true));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USERMOD_SN_PHOTORESISTOR
|
#ifdef USERMOD_SN_PHOTORESISTOR
|
||||||
@@ -385,7 +385,7 @@ void registerUsermods()
|
|||||||
|
|
||||||
|
|
||||||
#ifdef USERMOD_MPU6050_IMU
|
#ifdef USERMOD_MPU6050_IMU
|
||||||
usermods.add(new MPU6050Driver("mpu6050-IMU"));
|
usermods.add(new MPU6050Driver("mpu6050-IMU", true));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USERMOD_GAMES
|
#ifdef USERMOD_GAMES
|
||||||
|
|||||||
Reference in New Issue
Block a user