Changed CXX Flags to production values.
Fixed bug where after a restart/etc the fan level does not get set.
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
@@ -151,7 +151,7 @@ void GrowControl::newDeviceCallback(TfConnection& conn, TfDevice& device) {
|
||||
io16Bricklet = (TfIO16Bricklet*)&device;
|
||||
io16Bricklet->connect();
|
||||
io16Bricklet->setPortConfiguration('a', fan1PinMask, 'o', false);
|
||||
setFan1Level(fan1Level);
|
||||
setFan1Level(fan1Level, true);
|
||||
logger << log4cpp::Priority::INFO << "Added io16 device " << device.getDeviceName(true) << ".";
|
||||
}
|
||||
break;
|
||||
@@ -322,11 +322,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
@@ -95,7 +95,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