mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-26 17:46:14 +01:00
better variable name
This commit is contained in:
parent
2950ef010a
commit
495bbf66bf
|
@ -501,9 +501,9 @@ void MotorDriver::checkPowerOverload(bool useProgLimit, byte trackno) {
|
||||||
case POWERMODE::ALERT: {
|
case POWERMODE::ALERT: {
|
||||||
// set local flags that handle how much is output to diag (do not output duplicates)
|
// set local flags that handle how much is output to diag (do not output duplicates)
|
||||||
bool notFromOverload = (lastPowerMode != POWERMODE::OVERLOAD);
|
bool notFromOverload = (lastPowerMode != POWERMODE::OVERLOAD);
|
||||||
bool newPowerMode = (powerMode != lastPowerMode);
|
bool powerModeChange = (powerMode != lastPowerMode);
|
||||||
unsigned long now = micros();
|
unsigned long now = micros();
|
||||||
if (newPowerMode)
|
if (powerModeChange)
|
||||||
lastBadSample = now;
|
lastBadSample = now;
|
||||||
lastPowerMode = POWERMODE::ALERT;
|
lastPowerMode = POWERMODE::ALERT;
|
||||||
// check how long we have been in this state
|
// check how long we have been in this state
|
||||||
|
@ -513,7 +513,7 @@ void MotorDriver::checkPowerOverload(bool useProgLimit, byte trackno) {
|
||||||
lastBadSample = now;
|
lastBadSample = now;
|
||||||
unsigned long timeout = checkCurrent(useProgLimit) ? POWER_SAMPLE_IGNORE_FAULT_HIGH : POWER_SAMPLE_IGNORE_FAULT_LOW;
|
unsigned long timeout = checkCurrent(useProgLimit) ? POWER_SAMPLE_IGNORE_FAULT_HIGH : POWER_SAMPLE_IGNORE_FAULT_LOW;
|
||||||
if ( mslpc < timeout) {
|
if ( mslpc < timeout) {
|
||||||
if (newPowerMode)
|
if (powerModeChange)
|
||||||
DIAG(F("TRACK %c FAULT PIN (%M ignore)"), trackno + 'A', timeout);
|
DIAG(F("TRACK %c FAULT PIN (%M ignore)"), trackno + 'A', timeout);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -525,7 +525,7 @@ void MotorDriver::checkPowerOverload(bool useProgLimit, byte trackno) {
|
||||||
if (checkCurrent(useProgLimit)) {
|
if (checkCurrent(useProgLimit)) {
|
||||||
lastBadSample = now;
|
lastBadSample = now;
|
||||||
if (mslpc < POWER_SAMPLE_IGNORE_CURRENT) {
|
if (mslpc < POWER_SAMPLE_IGNORE_CURRENT) {
|
||||||
if (newPowerMode) {
|
if (powerModeChange) {
|
||||||
unsigned int mA=raw2mA(lastCurrent);
|
unsigned int mA=raw2mA(lastCurrent);
|
||||||
DIAG(F("TRACK %c CURRENT (%M ignore) %dmA"), trackno + 'A', POWER_SAMPLE_IGNORE_CURRENT, mA);
|
DIAG(F("TRACK %c CURRENT (%M ignore) %dmA"), trackno + 'A', POWER_SAMPLE_IGNORE_CURRENT, mA);
|
||||||
}
|
}
|
||||||
|
|
|
@ -190,7 +190,7 @@ void TrackManager::setDCSignal(int16_t cab, byte speedbyte) {
|
||||||
bool TrackManager::setTrackMode(byte trackToSet, TRACK_MODE mode, int16_t dcAddr) {
|
bool TrackManager::setTrackMode(byte trackToSet, TRACK_MODE mode, int16_t dcAddr) {
|
||||||
if (trackToSet>lastTrack || track[trackToSet]==NULL) return false;
|
if (trackToSet>lastTrack || track[trackToSet]==NULL) return false;
|
||||||
|
|
||||||
DIAG(F("Track=%c Mode=%d"),trackToSet+'A', mode);
|
//DIAG(F("Track=%c Mode=%d"),trackToSet+'A', mode);
|
||||||
// DC tracks require a motorDriver that can set brake!
|
// DC tracks require a motorDriver that can set brake!
|
||||||
if ((mode==TRACK_MODE_DC || mode==TRACK_MODE_DCX)
|
if ((mode==TRACK_MODE_DC || mode==TRACK_MODE_DCX)
|
||||||
&& !track[trackToSet]->brakeCanPWM()) {
|
&& !track[trackToSet]->brakeCanPWM()) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user