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

Compare commits

..

No commits in common. "196a27a27abf1ddab5c685a7ed8489dd68306890" and "0d679ad993662d9c5b6885bdb203a7759404686b" have entirely different histories.

7 changed files with 15 additions and 18 deletions

View File

@ -78,12 +78,6 @@ void setup()
// Initialise HAL layer before reading EEprom or setting up MotorDrivers // Initialise HAL layer before reading EEprom or setting up MotorDrivers
IODevice::begin(); IODevice::begin();
// As the setup of a motor shield may require a read of the current sense input from the ADC,
// let's make sure to initialise the ADCee class!
ADCee::begin();
// Set up MotorDrivers early to initialize all pins
TrackManager::Setup(MOTOR_SHIELD_TYPE);
DISPLAY_START ( DISPLAY_START (
// This block is still executed for DIAGS if display not in use // This block is still executed for DIAGS if display not in use
LCD(0,F("DCC-EX v%S"),F(VERSION)); LCD(0,F("DCC-EX v%S"),F(VERSION));
@ -106,8 +100,15 @@ void setup()
EthernetInterface::setup(); EthernetInterface::setup();
#endif // ETHERNET_ON #endif // ETHERNET_ON
// As the setup of a motor shield may require a read of the current sense input from the ADC,
// let's make sure to initialise the ADCee class!
ADCee::begin();
// Responsibility 3: Start the DCC engine. // Responsibility 3: Start the DCC engine.
DCC::begin(); // Note: this provides DCC with two motor drivers, main and prog, which handle the motor shield(s)
// Standard supported devices have pre-configured macros but custome hardware installations require
// detailed pin mappings and may also require modified subclasses of the MotorDriver to implement specialist logic.
// STANDARD_MOTOR_SHIELD, POLOLU_MOTOR_SHIELD, FIREBOX_MK1, FIREBOX_MK1S are pre defined in MotorShields.h
TrackManager::Setup(MOTOR_SHIELD_TYPE);
// Start RMFT aka EX-RAIL (ignored if no automnation) // Start RMFT aka EX-RAIL (ignored if no automnation)
RMFT::begin(); RMFT::begin();

View File

@ -60,7 +60,8 @@ const byte FN_GROUP_5=0x10;
FSH* DCC::shieldName=NULL; FSH* DCC::shieldName=NULL;
byte DCC::globalSpeedsteps=128; byte DCC::globalSpeedsteps=128;
void DCC::begin() { void DCC::begin(const FSH * motorShieldName) {
shieldName=(FSH *)motorShieldName;
StringFormatter::send(&USB_SERIAL,F("<iDCC-EX V-%S / %S / %S G-%S>\n"), F(VERSION), F(ARDUINO_TYPE), shieldName, F(GITHUB_SHA)); StringFormatter::send(&USB_SERIAL,F("<iDCC-EX V-%S / %S / %S G-%S>\n"), F(VERSION), F(ARDUINO_TYPE), shieldName, F(GITHUB_SHA));
#ifndef DISABLE_EEPROM #ifndef DISABLE_EEPROM
// Load stuff from EEprom // Load stuff from EEprom

5
DCC.h
View File

@ -51,10 +51,7 @@ const byte MAX_LOCOS = 30;
class DCC class DCC
{ {
public: public:
static inline void setShieldName(const FSH * motorShieldName) { static void begin(const FSH * motorShieldName);
shieldName=(FSH *)motorShieldName;
};
static void begin();
static void loop(); static void loop();
// Public DCC API functions // Public DCC API functions

View File

@ -1 +1 @@
#define GITHUB_SHA "devel-202306222129Z" #define GITHUB_SHA "devel-202306210849Z"

View File

@ -134,7 +134,7 @@ void TrackManager::Setup(const FSH * shieldname,
} }
} }
} }
DCC::setShieldName(shieldname); DCC::begin(shieldname);
} }
void TrackManager::addTrack(byte t, MotorDriver* driver) { void TrackManager::addTrack(byte t, MotorDriver* driver) {

View File

@ -176,7 +176,7 @@ bool WifiESP::setup(const char *SSid,
} }
if (!haveSSID) { if (!haveSSID) {
// prepare all strings // prepare all strings
String strSSID("DCCEX_"); String strSSID("DCC_");
String strPass("PASS_"); String strPass("PASS_");
String strMac = WiFi.macAddress(); String strMac = WiFi.macAddress();
strMac.remove(0,9); strMac.remove(0,9);

View File

@ -4,9 +4,7 @@
#include "StringFormatter.h" #include "StringFormatter.h"
#define VERSION "4.2.59" #define VERSION "4.2.57"
// 4.2.59 - Fix: AP SSID was DCC_ instead of DCCEX_
// 4.2.58 - Start motordriver as soon as possible but without waveform
// 4.2.57 - New overload handling (faster and handles commonFaultPin again) // 4.2.57 - New overload handling (faster and handles commonFaultPin again)
// - Optimize analog read STM32 // - Optimize analog read STM32
// 4.2.56 - Update IO_RotaryEncoder.h: // 4.2.56 - Update IO_RotaryEncoder.h: