mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-30 03:26:13 +01:00
Fix indentation and refactor for split class
This commit is contained in:
parent
49cd0a866c
commit
cdfb37c8b5
12
.vscode/settings.json
vendored
Normal file
12
.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"files.associations": {
|
||||||
|
"array": "cpp",
|
||||||
|
"deque": "cpp",
|
||||||
|
"string": "cpp",
|
||||||
|
"unordered_map": "cpp",
|
||||||
|
"vector": "cpp",
|
||||||
|
"string_view": "cpp",
|
||||||
|
"initializer_list": "cpp",
|
||||||
|
"cstdint": "cpp"
|
||||||
|
}
|
||||||
|
}
|
21
src/main.cpp
21
src/main.cpp
|
@ -4,24 +4,20 @@
|
||||||
|
|
||||||
#define DCC_IRQ_MICROSECONDS 29
|
#define DCC_IRQ_MICROSECONDS 29
|
||||||
|
|
||||||
#if defined(ARDUINO_AVR_UNO)
|
#define NUM_LOCOS 50
|
||||||
#define NUM_LOCOS_MAIN 20
|
|
||||||
#else
|
|
||||||
#define NUM_LOCOS_MAIN 50
|
|
||||||
#endif
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////
|
||||||
// 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(NUM_LOCOS_MAIN);
|
// DCCMain* mainTrack = DCC::Create_WSM_SAMCommandStation_Main(NUM_LOCOS);
|
||||||
// DCC* progTrack = DCC::Create_WSM_SAMCommandStation_Prog(2);
|
// DCCService* progTrack = DCC::Create_WSM_SAMCommandStation_Prog();
|
||||||
|
|
||||||
DCC* mainTrack = DCC::Create_Arduino_L298Shield_Main(NUM_LOCOS_MAIN);
|
// DCCMain* mainTrack = DCC::Create_Arduino_L298Shield_Main(NUM_LOCOS);
|
||||||
DCC* progTrack = DCC::Create_Arduino_L298Shield_Prog(2);
|
// DCCService* progTrack = DCC::Create_Arduino_L298Shield_Prog();
|
||||||
|
|
||||||
// DCC* mainTrack = DCC::Create_Pololu_MC33926Shield_Main(NUM_LOCOS_MAIN);
|
DCCMain* mainTrack = DCCMain::Create_Pololu_MC33926Shield_Main(NUM_LOCOS);
|
||||||
// DCC* progTrack = DCC::Create_Pololu_MC33926Shield_Prog(2);
|
DCCService* progTrack = DCCService::Create_Pololu_MC33926Shield_Prog();
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@ -33,12 +29,13 @@ void waveform_IrqHandler() {
|
||||||
#if defined(ARDUINO_ARCH_SAMD)
|
#if defined(ARDUINO_ARCH_SAMD)
|
||||||
void SERCOM4_Handler()
|
void SERCOM4_Handler()
|
||||||
{
|
{
|
||||||
mainTrack->hdw.railcomSerial()->IrqHandler();
|
mainTrack->railcom.getSerial()->IrqHandler();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
mainTrack->hdw.setup();
|
mainTrack->hdw.setup();
|
||||||
|
mainTrack->railcom.setup();
|
||||||
progTrack->hdw.setup();
|
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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user