1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-01-23 19:18:51 +01:00

D PROGBOOST ON command

This commit is contained in:
Harald Barth 2020-09-27 13:03:46 +02:00
parent c14596a252
commit 85d60dfbbd
5 changed files with 13 additions and 1 deletions

View File

@ -207,6 +207,9 @@ void DCC::writeCVBitMain(int cab, int cv, byte bNum, bool bValue) {
void DCC::setProgTrackSyncMain(bool on) { void DCC::setProgTrackSyncMain(bool on) {
DCCWaveform::progTrackSyncMain=on; DCCWaveform::progTrackSyncMain=on;
} }
void DCC::setProgTrackBoost(bool on) {
DCCWaveform::progTrackBoosted=on;
}
__FlashStringHelper* DCC::getMotorShieldName() { __FlashStringHelper* DCC::getMotorShieldName() {
return shieldName; return shieldName;

1
DCC.h
View File

@ -76,6 +76,7 @@ public:
static void setAccessory(int aAdd, byte aNum, bool activate); static void setAccessory(int aAdd, byte aNum, bool activate);
static bool writeTextPacket(byte *b, int nBytes); static bool writeTextPacket(byte *b, int nBytes);
static void setProgTrackSyncMain(bool on); // when true, prog track becomes driveable static void setProgTrackSyncMain(bool on); // when true, prog track becomes driveable
static void setProgTrackBoost(bool on); // when true, special prog track current limit does not apply
// ACKable progtrack calls bitresults callback 0,0 or -1, cv returns value or -1 // ACKable progtrack calls bitresults callback 0,0 or -1, cv returns value or -1
static void readCV(int cv, ACK_CALLBACK callback, bool blocking = false); static void readCV(int cv, ACK_CALLBACK callback, bool blocking = false);

View File

@ -45,6 +45,7 @@ const int HASH_KEYWORD_ACK = 3113;
const int HASH_KEYWORD_ON = 2657; const int HASH_KEYWORD_ON = 2657;
const int HASH_KEYWORD_DCC = 6436; const int HASH_KEYWORD_DCC = 6436;
const int HASH_KEYWORD_SLOW = -17209; const int HASH_KEYWORD_SLOW = -17209;
const int HASH_KEYWORD_PROGBOOST = -6353;
int DCCEXParser::stashP[MAX_PARAMS]; int DCCEXParser::stashP[MAX_PARAMS];
bool DCCEXParser::stashBusy; bool DCCEXParser::stashBusy;
@ -598,6 +599,11 @@ bool DCCEXParser::parseD(Print *stream, int params, int p[])
case HASH_KEYWORD_DCC: case HASH_KEYWORD_DCC:
DCCWaveform::setDiagnosticSlowWave(params >= 1 && p[1] == HASH_KEYWORD_SLOW); DCCWaveform::setDiagnosticSlowWave(params >= 1 && p[1] == HASH_KEYWORD_SLOW);
return true; return true;
case HASH_KEYWORD_PROGBOOST:
DCC::setProgTrackBoost(true);
return true;
default: // invalid/unknown default: // invalid/unknown
break; break;
} }

View File

@ -30,6 +30,7 @@ DCCWaveform DCCWaveform::progTrack(PREAMBLE_BITS_PROG, false);
bool DCCWaveform::progTrackSyncMain=false; bool DCCWaveform::progTrackSyncMain=false;
bool DCCWaveform::progTrackBoosted=false;
VirtualTimer * DCCWaveform::interruptTimer=NULL; VirtualTimer * DCCWaveform::interruptTimer=NULL;
void DCCWaveform::begin(MotorDriver * mainDriver, MotorDriver * progDriver, byte timerNumber) { void DCCWaveform::begin(MotorDriver * mainDriver, MotorDriver * progDriver, byte timerNumber) {
@ -128,7 +129,7 @@ void DCCWaveform::checkPowerOverload() {
if (millis() - lastSampleTaken < sampleDelay) return; if (millis() - lastSampleTaken < sampleDelay) return;
lastSampleTaken = millis(); lastSampleTaken = millis();
int tripValue= motorDriver->rawCurrentTripValue; int tripValue= motorDriver->rawCurrentTripValue;
if (!isMainTrack && !ackPending && !progTrackSyncMain) if (!isMainTrack && !ackPending && !progTrackSyncMain && !progTrackBoosted)
tripValue=progTripValue; tripValue=progTripValue;
switch (powerMode) { switch (powerMode) {

View File

@ -67,6 +67,7 @@ class DCCWaveform {
void setAckPending(); //prog track only void setAckPending(); //prog track only
byte getAck(); //prog track only 0=NACK, 1=ACK 2=keep waiting byte getAck(); //prog track only 0=NACK, 1=ACK 2=keep waiting
static bool progTrackSyncMain; // true when prog track is a siding switched to main static bool progTrackSyncMain; // true when prog track is a siding switched to main
static bool progTrackBoosted; // true when prog track is not current limited
inline void doAutoPowerOff() { inline void doAutoPowerOff() {
if (autoPowerOff) { if (autoPowerOff) {
setPowerMode(POWERMODE::OFF); setPowerMode(POWERMODE::OFF);