1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-12-24 05:11:24 +01:00

protect from setting unused pin

This commit is contained in:
Harald Barth 2022-05-21 09:51:38 +02:00
parent 6d2a9e3b36
commit 79ef114c0d

View File

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