From 9c66b0aea7c744bac0384d7ada7ffb958147ddd7 Mon Sep 17 00:00:00 2001 From: David Cutting Date: Wed, 27 May 2020 22:56:29 -0600 Subject: [PATCH] Fix SAMD21 EEPROM and prepare for initial testing. --- platformio.ini | 2 +- src/main.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/platformio.ini b/platformio.ini index 49dd6ea..b133bed 100644 --- a/platformio.ini +++ b/platformio.ini @@ -9,7 +9,7 @@ ; https://docs.platformio.org/page/projectconf.html [platformio] -default_envs = samd21 +default_envs = samd21, mega2560, mega328 [env] lib_deps = diff --git a/src/main.cpp b/src/main.cpp index 663db8d..9a03cc4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -8,13 +8,13 @@ // Motor driver selection: // 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* mainTrack = DCC::Create_Arduino_L298Shield_Main(50); // DCC* progTrack = DCC::Create_Arduino_L298Shield_Prog(2); -DCC* mainTrack = DCC::Create_Pololu_MC33926Shield_Main(10); +DCC* mainTrack = DCC::Create_Pololu_MC33926Shield_Main(50); DCC* progTrack = DCC::Create_Pololu_MC33926Shield_Prog(2); //////////////////////////////////////////////////////////////// @@ -34,11 +34,12 @@ void setup() { #if defined (ARDUINO_ARCH_SAMD) CommManager::registerInterface(new USBInterface(SerialUSB)); // Register SerialUSB as an interface + Wire.begin(); // Needed for EEPROM to work #elif defined(ARDUINO_ARCH_AVR) CommManager::registerInterface(new SerialInterface(Serial)); // Register Serial (USB port on mega/uno) as an interface #endif - //EEStore::init(); + EEStore::init(); StringParser::init(mainTrack, progTrack); // Set up the string parser to accept commands from the interfaces CommManager::showInitInfo();