mirror of
https://github.com/thelsing/knx.git
synced 2025-10-12 11:15:54 +02:00
43 lines
707 B
C++
43 lines
707 B
C++
#include "runningstate.h"
|
|
#include "programmingmodestate.h"
|
|
#include "wpsstate.h"
|
|
#include "knx_facade.h"
|
|
|
|
#ifdef USE_STATES
|
|
|
|
RunningState runningState = RunningState();
|
|
|
|
void RunningState::shortButtonPress()
|
|
{
|
|
switchToSate(programModeState);
|
|
}
|
|
|
|
void RunningState::longButtonPress()
|
|
{
|
|
switchToSate(wpsState);
|
|
}
|
|
|
|
void RunningState::enterState()
|
|
{
|
|
if (_initialized)
|
|
return;
|
|
|
|
knx.enabled(true);
|
|
_initialized = true;
|
|
}
|
|
|
|
void RunningState::leaveState()
|
|
{
|
|
if (nextState != &programModeState)
|
|
{
|
|
_initialized = false;
|
|
knx.enabled(false);
|
|
}
|
|
}
|
|
|
|
void RunningState::loop()
|
|
{
|
|
State::loop();
|
|
knx.knxLoop();
|
|
}
|
|
#endif |