1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-22 23:56:13 +01:00

Update MotorDriver.cpp

Remove unnecessary and undesirable interrupt disable/enable when writing to HAL driver.
This commit is contained in:
Neil McKechnie 2023-01-14 17:10:45 +00:00
parent a6ae1a48a2
commit 79437bbf37

View File

@ -144,16 +144,12 @@ bool MotorDriver::isPWMCapable() {
void MotorDriver::setPower(POWERMODE mode) {
bool on=mode==POWERMODE::ON;
if (on) {
noInterrupts();
IODevice::write(powerPin,invertPower ? LOW : HIGH);
interrupts();
if (isProgTrack)
DCCWaveform::progTrack.clearResets();
}
else {
noInterrupts();
IODevice::write(powerPin,invertPower ? HIGH : LOW);
interrupts();
}
powerMode=mode;
}