1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-12-23 21:01:25 +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"
#elif defined(ARDUINO_ARCH_MEGAAVR)
#define ARDUINO_TYPE "MEGAAVR"
#elif defined(TEENSYDUINO)
#define ARDUINO_TYPE "TEENSY"
#elif defined(ARDUINO_TEENSY32)
#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
#error CANNOT COMPILE - DCC++ EX ONLY WORKS WITH AN ARDUINO UNO, NANO 328, OR ARDUINO MEGA 1280/2560
#endif

View File

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