Merge with 7617aa6dfa5e1c5f1957d02b9c3137f2c5677676
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
||||
|
||||
|
||||
|
||||
CXX_FLAGS = -O0 -g3 -Wall -std=c++11
|
||||
CXX_FLAGS = -O2 -Wall -std=c++11
|
||||
CXX_INCL = -I ../TinkerforgeCPPsimple/include -I ../TinkerforgeCPPsimple/third-party/tinkerforge/include -I ../TinkerforgeCPPsimple/third-party/log4cpp/include -I /usr/include
|
||||
|
||||
LD_FLAGS = -pthread
|
||||
|
||||
+3
-3
@@ -186,7 +186,7 @@ void GrowControl::newDeviceCallback(TfConnection& conn, TfDevice& device) {
|
||||
io16ConnectFlag = true;
|
||||
io16MissingFlag = false;
|
||||
io16Bricklet->addListener(*this);
|
||||
setFan1Level(fan1Level);
|
||||
setFan1Level(fan1Level, true);
|
||||
logger << log4cpp::Priority::INFO << "Added io16 device " << device.getDeviceName(true) << ".";
|
||||
}
|
||||
break;
|
||||
@@ -367,11 +367,11 @@ bool GrowControl::isFan1Connected() {
|
||||
return (io16Bricklet != nullptr && io16Bricklet->getDeviceState() == TfDeviceState::CONNECTED);
|
||||
}
|
||||
|
||||
void GrowControl::setFan1Level(unsigned level) {
|
||||
void GrowControl::setFan1Level(unsigned level, bool force) {
|
||||
if (level > fan1UpperLimit) {
|
||||
level = fan1UpperLimit;
|
||||
}
|
||||
if (level != fan1Level) {
|
||||
if (level != fan1Level || force) {
|
||||
fan1Level = level;
|
||||
if (isFan1Connected()) {
|
||||
if (fan1Level <= 0) {
|
||||
|
||||
+1
-1
@@ -112,7 +112,7 @@ public:
|
||||
|
||||
bool isFan1Connected();
|
||||
unsigned getFan1Level(bool force = false);
|
||||
void setFan1Level(unsigned level);
|
||||
void setFan1Level(unsigned level, bool force = false);
|
||||
unsigned getFan1UpperLimit();
|
||||
void setFan1UpperLimit(unsigned limit);
|
||||
unsigned getFan1Max();
|
||||
|
||||
Reference in New Issue
Block a user