Skip to content

Commit

Permalink
Tidy and version
Browse files Browse the repository at this point in the history
  • Loading branch information
Asbelos committed Feb 16, 2024
1 parent 5742b71 commit 7ee4188
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
11 changes: 4 additions & 7 deletions DCCEXParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,16 +387,13 @@ void DCCEXParser::parseOne(Print *stream, byte *com, RingStream * ringStream)

case 'A': // EXTENDED ACCESSORY <A address value>
{
// Note: if this happens to match a defined EXRAIL
// DCCX_SIGNAL, then EXRAIL will have intercepted
// this command alrerady.
if (params!=2) break;
if (p[0] != (p[0] & 0x7F)) break;
if (p[1] != (p[1] & 0x1F)) break;
#ifdef EXRAIL_ACTIVE
// Ask exrail if this is just changing the aspect on a
// predefined DCCX_SIGNAL. Because this will handle all
// the IFRED and ONRED type issues at the same time.
if (RMFT2::signalAspectEvent(p[0],p[1])) return;
#endif
DCC::setExtendedAccessory(p[0],p[1],3);
DCC::setExtendedAccessory(p[0],p[1]);
}
return;

Expand Down
5 changes: 4 additions & 1 deletion EXRAIL2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,10 @@ void RMFT2::loop2() {
}
case OPCODE_ASPECT: {
// operand is address<<5 | value
DCC::setExtendedAccessory(operand>>5, operand & 0x1F);
int16_t address=operand>>5;
byte aspect=operand & 0x1f;
if (!signalAspectEvent(address,aspect))
DCC::setExtendedAccessory(address,aspect);
break;
}

Expand Down
8 changes: 8 additions & 0 deletions EXRAIL2Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ void RMFT2::ComandFilter(Print * stream, byte & opcode, byte & paramCount, int16
opcode=0;
break;

case 'A': // <A address aspect>
if (paramCount!=2) break;
// Ask exrail if this is just changing the aspect on a
// predefined DCCX_SIGNAL. Because this will handle all
// the IFRED and ONRED type issues at the same time.
if (signalAspectEvent(p[0],p[1])) opcode=0; // all done
break;

case 'L':
// This entire code block is compiled out if LLC macros not used
if (!(compileFeatures & FEATURE_LCC)) return;
Expand Down
6 changes: 5 additions & 1 deletion version.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@

#include "StringFormatter.h"

#define VERSION "5.2.33"
#define VERSION "5.2.34"
// 5.2.34 - <A address aspect> Command fopr DCC Extended Accessories
// - Exrail ASPECT(address,aspect) for above.
// - EXRAIL DCCX_SIGNAL(Address,redAspect,amberAspect,greenAspect)
// - Exrail intercept <A ...> for DCC Signals.
// 5.2.33 - Exrail CONFIGURE_SERVO(vpin,pos1,pos2,profile)
// 5.2.32 - Railcom Cutout (Initial trial Mega2560 only)
// 5.2.31 - Exrail JMRI_SENSOR(vpin [,count]) creates <S> types.
Expand Down

0 comments on commit 7ee4188

Please sign in to comment.