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

More library changes.

This commit is contained in:
David Cutting 2020-06-02 13:46:37 -06:00
parent 545eb54ee5
commit 872ed372df

View File

@ -8,11 +8,11 @@
// Motor driver selection: // Motor driver selection:
// Comment out all but the two lines that you want to use // Comment out all but the two lines that you want to use
DCC* mainTrack = DCC::Create_WSM_SAMCommandStation_Main(50); // DCC* mainTrack = DCC::Create_WSM_SAMCommandStation_Main(50);
DCC* progTrack = DCC::Create_WSM_SAMCommandStation_Prog(2); // DCC* progTrack = DCC::Create_WSM_SAMCommandStation_Prog(2);
// DCC* mainTrack = DCC::Create_Arduino_L298Shield_Main(50); DCC* mainTrack = DCC::Create_Arduino_L298Shield_Main(50);
// DCC* progTrack = DCC::Create_Arduino_L298Shield_Prog(2); DCC* progTrack = DCC::Create_Arduino_L298Shield_Prog(2);
// DCC* mainTrack = DCC::Create_Pololu_MC33926Shield_Main(50); // DCC* mainTrack = DCC::Create_Pololu_MC33926Shield_Main(50);
// DCC* progTrack = DCC::Create_Pololu_MC33926Shield_Prog(2); // DCC* progTrack = DCC::Create_Pololu_MC33926Shield_Prog(2);
@ -27,16 +27,16 @@ void waveform_IrqHandler() {
#if defined(ARDUINO_ARCH_SAMD) #if defined(ARDUINO_ARCH_SAMD)
void SERCOM4_Handler() void SERCOM4_Handler()
{ {
mainTrack->hdw.railcom_serial->IrqHandler(); mainTrack->hdw.railcomSerial()->IrqHandler();
} }
#endif #endif
void setup() { void setup() {
mainTrack->hdw.init(); mainTrack->hdw.setup();
progTrack->hdw.init(); progTrack->hdw.setup();
// TimerA is TCC0 on SAMD21, Timer1 on MEGA2560, and Timer1 on MEGA328 // TimerA is TCC0 on SAMD21, Timer1 on MEGA2560, and Timer1 on MEGA328
// We will fire an interrupt every 58us to generate the signal on the track // We will fire an interrupt every 29us to generate the signal on the track
TimerA.initialize(); TimerA.initialize();
TimerA.setPeriod(DCC_IRQ_MICROSECONDS); TimerA.setPeriod(DCC_IRQ_MICROSECONDS);
TimerA.attachInterrupt(waveform_IrqHandler); TimerA.attachInterrupt(waveform_IrqHandler);