mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-12-24 21:21:24 +01:00
protect from setting unused pin
This commit is contained in:
parent
6d2a9e3b36
commit
79ef114c0d
@ -160,6 +160,8 @@ int MotorDriver::getCurrentRaw() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MotorDriver::setDCSignal(byte speedcode) {
|
void MotorDriver::setDCSignal(byte speedcode) {
|
||||||
|
if (brakePin == UNUSED_PIN)
|
||||||
|
return;
|
||||||
// spedcoode is a dcc speed /direction
|
// spedcoode is a dcc speed /direction
|
||||||
byte tSpeed=speedcode & 0x7F;
|
byte tSpeed=speedcode & 0x7F;
|
||||||
// DCC Speed with 0,1 stop and speed steps 2 to 127
|
// DCC Speed with 0,1 stop and speed steps 2 to 127
|
||||||
|
Loading…
Reference in New Issue
Block a user