corrected float with DPT9 (#27)

* corrected float with DPT9

* Switch Programming-LED also via Bus/ETS

* Again: Prog-LED switchable from bus/ETS
This commit is contained in:
mumpf 2019-08-17 21:14:46 +02:00 committed by thelsing
parent 626d1b73d1
commit 74fe42acaf
2 changed files with 25 additions and 18 deletions

View File

@ -532,6 +532,8 @@ struct tm KNXValue::timeValue() const
KNXValue::KNXValue(float value)
{
_value.doubleValue = value;
_type = DoubleType;
}
KNXValue& KNXValue::operator=(const float value)

View File

@ -17,11 +17,13 @@ Bau57B0 bau(platform);
#endif
bool _toogleProgMode = false;
bool _progLedState = false;
#ifndef __linux__
KnxFacade knx(bau);
ICACHE_RAM_ATTR void buttonUp()
{
_toogleProgMode = true;
_toogleProgMode = true;
}
#endif
@ -48,17 +50,6 @@ bool KnxFacade::progMode()
void KnxFacade::progMode(bool value)
{
if (value)
{
println("progmode on");
digitalWrite(knx.ledPin(), _ledPinActiveOn);
}
else
{
println("progmode off");
digitalWrite(knx.ledPin(), HIGH - _ledPinActiveOn);
}
_bau.deviceObject().progMode(value);
}
@ -109,11 +100,25 @@ void KnxFacade::writeMemory()
void KnxFacade::loop()
{
if(_toogleProgMode)
{
progMode(!progMode());
_toogleProgMode = false;
}
if (progMode() != _progLedState)
{
_progLedState = progMode();
if (_progLedState)
{
println("progmode on");
digitalWrite(knx.ledPin(), _ledPinActiveOn);
}
else
{
println("progmode off");
digitalWrite(knx.ledPin(), HIGH - _ledPinActiveOn);
}
}
if (_toogleProgMode)
{
progMode(!progMode());
_toogleProgMode = false;
}
_bau.loop();
}
@ -150,7 +155,7 @@ void KnxFacade::version(uint16_t value)
void KnxFacade::start()
{
pinMode(_ledPin, OUTPUT);
digitalWrite(_ledPin, HIGH - _ledPinActiveOn);
pinMode(_buttonPin, INPUT_PULLUP);