avoid sending user command directly if manny user commands are issued in a short period of time
This commit is contained in:
parent
ab2767af18
commit
395c9f3e2c
11
train.cpp
11
train.cpp
|
@ -105,7 +105,7 @@ void Train::setSpeed(int8_t speed)
|
|||
}
|
||||
sei();
|
||||
}
|
||||
else
|
||||
else if(!directSendBlock)
|
||||
{
|
||||
sendData();
|
||||
}
|
||||
|
@ -121,7 +121,8 @@ void Train::stop()
|
|||
{
|
||||
_speed = 0;
|
||||
_function = 0;
|
||||
sendData();
|
||||
if(!directSendBlock)
|
||||
sendData();
|
||||
}
|
||||
|
||||
|
||||
|
@ -158,7 +159,8 @@ uint16_t Train::getLastPacket()
|
|||
void Train::reverse()
|
||||
{
|
||||
_direction = !_direction;
|
||||
sendData();
|
||||
if(!directSendBlock)
|
||||
sendData();
|
||||
}
|
||||
|
||||
|
||||
|
@ -177,7 +179,8 @@ void Train::sendFunction(const uint8_t function, bool enable)
|
|||
if(function > 3)
|
||||
return;
|
||||
_function = (_function & ~(1 << function)) | (enable << function);
|
||||
sendData();
|
||||
if(!directSendBlock)
|
||||
sendData();
|
||||
}
|
||||
|
||||
uint8_t Train::getQuirks()
|
||||
|
|
Loading…
Reference in a new issue