mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-25 00:56:13 +01:00
Compare commits
3 Commits
0d679ad993
...
196a27a27a
Author | SHA1 | Date | |
---|---|---|---|
|
196a27a27a | ||
|
99b6ca025a | ||
|
db555e8820 |
|
@ -78,6 +78,12 @@ 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));
|
||||||
|
@ -100,15 +106,8 @@ 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.
|
||||||
// Note: this provides DCC with two motor drivers, main and prog, which handle the motor shield(s)
|
DCC::begin();
|
||||||
// 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();
|
||||||
|
|
3
DCC.cpp
3
DCC.cpp
|
@ -60,8 +60,7 @@ 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(const FSH * motorShieldName) {
|
void DCC::begin() {
|
||||||
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
5
DCC.h
|
@ -51,7 +51,10 @@ const byte MAX_LOCOS = 30;
|
||||||
class DCC
|
class DCC
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static void begin(const FSH * motorShieldName);
|
static inline void setShieldName(const FSH * motorShieldName) {
|
||||||
|
shieldName=(FSH *)motorShieldName;
|
||||||
|
};
|
||||||
|
static void begin();
|
||||||
static void loop();
|
static void loop();
|
||||||
|
|
||||||
// Public DCC API functions
|
// Public DCC API functions
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
#define GITHUB_SHA "devel-202306210849Z"
|
#define GITHUB_SHA "devel-202306222129Z"
|
||||||
|
|
|
@ -134,7 +134,7 @@ void TrackManager::Setup(const FSH * shieldname,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DCC::begin(shieldname);
|
DCC::setShieldName(shieldname);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrackManager::addTrack(byte t, MotorDriver* driver) {
|
void TrackManager::addTrack(byte t, MotorDriver* driver) {
|
||||||
|
|
|
@ -176,7 +176,7 @@ bool WifiESP::setup(const char *SSid,
|
||||||
}
|
}
|
||||||
if (!haveSSID) {
|
if (!haveSSID) {
|
||||||
// prepare all strings
|
// prepare all strings
|
||||||
String strSSID("DCC_");
|
String strSSID("DCCEX_");
|
||||||
String strPass("PASS_");
|
String strPass("PASS_");
|
||||||
String strMac = WiFi.macAddress();
|
String strMac = WiFi.macAddress();
|
||||||
strMac.remove(0,9);
|
strMac.remove(0,9);
|
||||||
|
|
|
@ -4,7 +4,9 @@
|
||||||
#include "StringFormatter.h"
|
#include "StringFormatter.h"
|
||||||
|
|
||||||
|
|
||||||
#define VERSION "4.2.57"
|
#define VERSION "4.2.59"
|
||||||
|
// 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:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user