mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2025-07-28 18:03:45 +02:00
Compare commits
1 Commits
v5.5.37-De
...
BandO
Author | SHA1 | Date | |
---|---|---|---|
|
a98657fef2 |
@@ -156,10 +156,14 @@ void DCCWaveform::checkPowerOverload(bool ackManagerActive) {
|
||||
else
|
||||
if (power_sample_overload_wait>POWER_SAMPLE_OVERLOAD_WAIT) power_sample_overload_wait=POWER_SAMPLE_OVERLOAD_WAIT;
|
||||
} else {
|
||||
setPowerMode(POWERMODE::OVERLOAD);
|
||||
unsigned int mA=motorDriver->raw2mA(lastCurrent);
|
||||
unsigned int maxmA=motorDriver->raw2mA(tripValue);
|
||||
power_good_counter=0;
|
||||
if (power_good_counter > 0) {
|
||||
power_good_counter = 0;
|
||||
DIAG(F("*** %S TRACK POWER WARNING current=%d max=%d ***"), isMainTrack ? F("MAIN") : F("PROG"), mA, maxmA);
|
||||
break;
|
||||
}
|
||||
setPowerMode(POWERMODE::OVERLOAD);
|
||||
sampleDelay = power_sample_overload_wait;
|
||||
DIAG(F("*** %S TRACK POWER OVERLOAD current=%d max=%d offtime=%d ***"), isMainTrack ? F("MAIN") : F("PROG"), mA, maxmA, sampleDelay);
|
||||
if (power_sample_overload_wait >= 10000)
|
||||
|
@@ -23,7 +23,7 @@
|
||||
#include "MotorDriver.h"
|
||||
|
||||
// Wait times for power management. Unit: milliseconds
|
||||
const int POWER_SAMPLE_ON_WAIT = 100;
|
||||
const int POWER_SAMPLE_ON_WAIT = 50;
|
||||
const int POWER_SAMPLE_OFF_WAIT = 1000;
|
||||
const int POWER_SAMPLE_OVERLOAD_WAIT = 20;
|
||||
|
||||
|
Reference in New Issue
Block a user