1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-30 03:26:13 +01:00

Minor changes to Arduino Type List & DCCWaveform

This commit is contained in:
Mike S 2021-03-26 07:37:17 -04:00
parent 8e63c452b2
commit 54773297bf
2 changed files with 17 additions and 2 deletions

12
DCC.h
View File

@ -168,8 +168,16 @@ private:
#define ARDUINO_TYPE "MEGA" #define ARDUINO_TYPE "MEGA"
#elif defined(ARDUINO_ARCH_MEGAAVR) #elif defined(ARDUINO_ARCH_MEGAAVR)
#define ARDUINO_TYPE "MEGAAVR" #define ARDUINO_TYPE "MEGAAVR"
#elif defined(TEENSYDUINO) #elif defined(ARDUINO_TEENSY32)
#define ARDUINO_TYPE "TEENSY" #define ARDUINO_TYPE "TEENSY32"
#elif defined(ARDUINO_TEENSY35)
#define ARDUINO_TYPE "TEENSY35"
#elif defined(ARDUINO_TEENSY36)
#define ARDUINO_TYPE "TEENSY36"
#elif defined(ARDUINO_TEENSY40)
#define ARDUINO_TYPE "TEENSY40"
#elif defined(ARDUINO_TEENSY41)
#define ARDUINO_TYPE "TEENSY41"
#else #else
#error CANNOT COMPILE - DCC++ EX ONLY WORKS WITH AN ARDUINO UNO, NANO 328, OR ARDUINO MEGA 1280/2560 #error CANNOT COMPILE - DCC++ EX ONLY WORKS WITH AN ARDUINO UNO, NANO 328, OR ARDUINO MEGA 1280/2560
#endif #endif

View File

@ -52,12 +52,19 @@ void DCCWaveform::begin(MotorDriver * mainDriver, MotorDriver * progDriver) {
DCCTimer::begin(DCCWaveform::interruptHandler); DCCTimer::begin(DCCWaveform::interruptHandler);
} }
#if defined(TEENSYDUINO)
void DCCWaveform::loop(bool ackManagerActive) { void DCCWaveform::loop(bool ackManagerActive) {
noInterrupts(); noInterrupts();
mainTrack.checkPowerOverload(false); mainTrack.checkPowerOverload(false);
progTrack.checkPowerOverload(ackManagerActive); progTrack.checkPowerOverload(ackManagerActive);
interrupts(); interrupts();
} }
#else
void DCCWaveform::loop(bool ackManagerActive) {
mainTrack.checkPowerOverload(false);
progTrack.checkPowerOverload(ackManagerActive);
}
#endif
void DCCWaveform::interruptHandler() { void DCCWaveform::interruptHandler() {
// call the timer edge sensitive actions for progtrack and maintrack // call the timer edge sensitive actions for progtrack and maintrack