Start motordriver as soon as possible but without waveform

This commit is contained in:
Harald Barth 2023-06-22 22:57:59 +02:00
parent 0d679ad993
commit db555e8820
6 changed files with 12 additions and 11 deletions

View File

@ -77,6 +77,8 @@ void setup()
// Initialise HAL layer before reading EEprom or setting up MotorDrivers
IODevice::begin();
// Set up MotorDrivers early to initialize all pins
TrackManager::Setup(MOTOR_SHIELD_TYPE);
DISPLAY_START (
// This block is still executed for DIAGS if display not in use
@ -104,11 +106,7 @@ void setup()
// let's make sure to initialise the ADCee class!
ADCee::begin();
// Responsibility 3: Start the DCC engine.
// 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);
DCC::begin();
// Start RMFT aka EX-RAIL (ignored if no automnation)
RMFT::begin();

View File

@ -60,8 +60,7 @@ const byte FN_GROUP_5=0x10;
FSH* DCC::shieldName=NULL;
byte DCC::globalSpeedsteps=128;
void DCC::begin(const FSH * motorShieldName) {
shieldName=(FSH *)motorShieldName;
void DCC::begin() {
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
// Load stuff from EEprom

5
DCC.h
View File

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

View File

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

View File

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

View File

@ -4,7 +4,8 @@
#include "StringFormatter.h"
#define VERSION "4.2.57"
#define VERSION "4.2.58"
// 4.2.58 - Start motordriver as soon as possible but without waveform
// 4.2.57 - New overload handling (faster and handles commonFaultPin again)
// - Optimize analog read STM32
// 4.2.56 - Update IO_RotaryEncoder.h: