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) KNXValue::KNXValue(float value)
{ {
_value.doubleValue = value;
_type = DoubleType;
} }
KNXValue& KNXValue::operator=(const float value) KNXValue& KNXValue::operator=(const float value)

View File

@ -17,6 +17,8 @@ Bau57B0 bau(platform);
#endif #endif
bool _toogleProgMode = false; bool _toogleProgMode = false;
bool _progLedState = false;
#ifndef __linux__ #ifndef __linux__
KnxFacade knx(bau); KnxFacade knx(bau);
ICACHE_RAM_ATTR void buttonUp() ICACHE_RAM_ATTR void buttonUp()
@ -48,17 +50,6 @@ bool KnxFacade::progMode()
void KnxFacade::progMode(bool value) 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); _bau.deviceObject().progMode(value);
} }
@ -109,7 +100,21 @@ void KnxFacade::writeMemory()
void KnxFacade::loop() void KnxFacade::loop()
{ {
if(_toogleProgMode) 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()); progMode(!progMode());
_toogleProgMode = false; _toogleProgMode = false;