1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-24 08:36:14 +01:00

Compare commits

..

3 Commits

Author SHA1 Message Date
Asbelos
d877fc315e Fix non-routestate code eliminator 2023-11-10 23:56:41 +00:00
Asbelos
6c18226cb5 Fix non-exrail crash 2023-11-10 23:46:17 +00:00
Asbelos
1c5f299b0e Fix ESP32 cast issue 2023-11-10 23:28:41 +00:00
3 changed files with 14 additions and 10 deletions

View File

@ -332,7 +332,7 @@ void RMFT2::setTurntableHiddenState(Turntable * tto) {
char RMFT2::getRouteType(int16_t id) {
int16_t progCounter=routeLookup->find(id);
if (progCounter>=0) {
OPCODE type=GET_OPCODE;
byte type=GET_OPCODE;
if (type==OPCODE_ROUTE) return 'R';
if (type==OPCODE_AUTOMATION) return 'A';
}

View File

@ -122,7 +122,7 @@ void RMFT2::ComandFilter(Print * stream, byte & opcode, byte & paramCount, int16
case 'J': // throttle info commands
// This entire code block is compiled out if FEATURE_ROUTESTATE macros not used
if (paramCount<1 || !(compileFeatures & FEATURE_ROUTESTATE)) return;
if (paramCount<1) return;
switch(p[0])
case HASH_KEYWORD_A: // <JA> returns automations/routes
if (paramCount==1) {// <JA>
@ -137,6 +137,7 @@ void RMFT2::ComandFilter(Print * stream, byte & opcode, byte & paramCount, int16
StringFormatter::send(stream,F("<jA %d %c \"%S\">\n"),
id, getRouteType(id), getRouteDescription(id));
if (compileFeatures & FEATURE_ROUTESTATE) {
// Send any non-default button states or captions
int16_t statePos=routeLookup->findPosition(id);
if (statePos>=0) {
@ -145,6 +146,7 @@ void RMFT2::ComandFilter(Print * stream, byte & opcode, byte & paramCount, int16
if (routeCaptionArray[statePos])
StringFormatter::send(stream,F("<jB %d \"%S\">\n"), id,routeCaptionArray[statePos]);
}
}
opcode=0;
return;
}

View File

@ -676,8 +676,10 @@ void MotorDriver::checkPowerOverload(bool useProgLimit, byte trackno) {
power_sample_overload_wait *= 2;
if (power_sample_overload_wait > POWER_SAMPLE_RETRY_MAX)
power_sample_overload_wait = POWER_SAMPLE_RETRY_MAX;
#ifdef EXRAIL_ACTIVE
DIAG(F("Calling EXRAIL"));
RMFT2::powerEvent(trackno, true); // Tell EXRAIL we have an overload
#endif
// power on test
DIAG(F("TRACK %c POWER RESTORE (after %4M)"), trackno + 'A', mslpc);
setPower(POWERMODE::ALERT);