1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-07-28 09:53:45 +02:00

withrottle changes

disallow acquire if address in use
return error on address 0 and mismatched L/S
move init string to 'HU' reply
some message format fixes
comment-out some DIAGs to show only in and out message traffic
This commit is contained in:
mstevetodd
2020-08-12 11:17:05 -04:00
parent 9cc8843e15
commit ecbedd26bc
6 changed files with 78 additions and 48 deletions

View File

@@ -95,6 +95,15 @@ bool DCC::getThrottleDirection(int cab) {
return (speedTable[reg].speedCode & 0x80) !=0;
}
bool DCC::isThrottleInUse(int locoId) {
// return true if this loco address is already in table, false otherwise
int reg;
for (reg = 0; reg < MAX_LOCOS; reg++) {
if (speedTable[reg].loco == locoId) return true;
}
return false;
}
// Set function to value on or off
void DCC::setFn( int cab, byte functionNumber, bool on) {
if (cab<=0 || functionNumber>28) return;