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:
matzman
2014-06-20 13:25:56 +02:00
parent 40d5753edc
commit 7a2e77a5ae
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
@@ -151,7 +151,7 @@ void GrowControl::newDeviceCallback(TfConnection& conn, TfDevice& device) {
io16Bricklet = (TfIO16Bricklet*)&device; io16Bricklet = (TfIO16Bricklet*)&device;
io16Bricklet->connect(); io16Bricklet->connect();
io16Bricklet->setPortConfiguration('a', fan1PinMask, 'o', false); io16Bricklet->setPortConfiguration('a', fan1PinMask, 'o', false);
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;
@@ -322,11 +322,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
@@ -95,7 +95,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();