Merge with 7617aa6dfa5e1c5f1957d02b9c3137f2c5677676

This commit is contained in:
hg
2014-06-30 22:22:40 +02:00
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -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 CXX_INCL = -I ../TinkerforgeCPPsimple/include -I ../TinkerforgeCPPsimple/third-party/tinkerforge/include -I ../TinkerforgeCPPsimple/third-party/log4cpp/include -I /usr/include
LD_FLAGS = -pthread LD_FLAGS = -pthread
+3 -3
View File
@@ -186,7 +186,7 @@ void GrowControl::newDeviceCallback(TfConnection& conn, TfDevice& device) {
io16ConnectFlag = true; io16ConnectFlag = true;
io16MissingFlag = false; io16MissingFlag = false;
io16Bricklet->addListener(*this); io16Bricklet->addListener(*this);
setFan1Level(fan1Level); setFan1Level(fan1Level, true);
logger << log4cpp::Priority::INFO << "Added io16 device " << device.getDeviceName(true) << "."; logger << log4cpp::Priority::INFO << "Added io16 device " << device.getDeviceName(true) << ".";
} }
break; break;
@@ -367,11 +367,11 @@ bool GrowControl::isFan1Connected() {
return (io16Bricklet != nullptr && io16Bricklet->getDeviceState() == TfDeviceState::CONNECTED); return (io16Bricklet != nullptr && io16Bricklet->getDeviceState() == TfDeviceState::CONNECTED);
} }
void GrowControl::setFan1Level(unsigned level) { void GrowControl::setFan1Level(unsigned level, bool force) {
if (level > fan1UpperLimit) { if (level > fan1UpperLimit) {
level = fan1UpperLimit; level = fan1UpperLimit;
} }
if (level != fan1Level) { if (level != fan1Level || force) {
fan1Level = level; fan1Level = level;
if (isFan1Connected()) { if (isFan1Connected()) {
if (fan1Level <= 0) { if (fan1Level <= 0) {
+1 -1
View File
@@ -112,7 +112,7 @@ public:
bool isFan1Connected(); bool isFan1Connected();
unsigned getFan1Level(bool force = false); unsigned getFan1Level(bool force = false);
void setFan1Level(unsigned level); void setFan1Level(unsigned level, bool force = false);
unsigned getFan1UpperLimit(); unsigned getFan1UpperLimit();
void setFan1UpperLimit(unsigned limit); void setFan1UpperLimit(unsigned limit);
unsigned getFan1Max(); unsigned getFan1Max();