avoid sending user command directly if manny user commands are issued in a short period of time

This commit is contained in:
2022-03-03 16:46:37 +01:00
parent ab2767af18
commit 395c9f3e2c
5 changed files with 31 additions and 26 deletions

View File

@ -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()