From db31a2b3550054f444625ab2d6307fd922df78e2 Mon Sep 17 00:00:00 2001 From: Asbelos Date: Sun, 23 Aug 2020 14:17:54 +0100 Subject: [PATCH] Default to POWERMODE::OFF --- DCCWaveform.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/DCCWaveform.cpp b/DCCWaveform.cpp index f253014..6f38663 100644 --- a/DCCWaveform.cpp +++ b/DCCWaveform.cpp @@ -33,13 +33,14 @@ void DCCWaveform::begin(MotorDriver * mainDriver, MotorDriver * progDriver) { mainTrack.motorDriver=mainDriver; progTrack.motorDriver=progDriver; + mainTrack.setPowerMode(POWERMODE::OFF); + progTrack.setPowerMode(POWERMODE::OFF); + TimerA.initialize(); - TimerA.setPeriod(58); + TimerA.setPeriod(58); // this is the 58uS DCC 1-bit waveform half-cycle TimerA.attachInterrupt(interruptHandler); TimerA.start(); - mainTrack.setPowerMode(POWERMODE::ON); - progTrack.setPowerMode(POWERMODE::ON); - + } void DCCWaveform::loop() {