Skip to content

Commit

Permalink
SET/RESET range
Browse files Browse the repository at this point in the history
  • Loading branch information
Asbelos committed Nov 5, 2024
1 parent d8f6d91 commit 03bd1e8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
13 changes: 7 additions & 6 deletions EXRAIL2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -677,13 +677,14 @@ void RMFT2::loop2() {
break;

case OPCODE_SET:
killBlinkOnVpin(operand);
IODevice::write(operand,true);
break;

case OPCODE_RESET:
killBlinkOnVpin(operand);
IODevice::write(operand,false);
{
auto count=getOperand(1);
for (int i=0;i<count;i++) {
killBlinkOnVpin(operand+i);
IODevice::write(operand+i,opcode==OPCODE_SET);
}
}
break;

case OPCODE_BLINK:
Expand Down
4 changes: 2 additions & 2 deletions EXRAIL2MacroReset.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@
#define READ_LOCO
#define RED(signal_id)
#define RESERVE(blockid)
#define RESET(pin)
#define RESET(pin,count...)
#define RESUME
#define RETURN
#define REV(speed)
Expand All @@ -335,7 +335,7 @@
#define SERVO2(id,position,duration)
#define SERVO_SIGNAL(vpin,redpos,amberpos,greenpos)
#define SERVO_TURNOUT(id,pin,activeAngle,inactiveAngle,profile,description...)
#define SET(pin)
#define SET(pin,count...)
#define SET_TRACK(track,mode)
#define SET_POWER(track,onoff)
#define SETLOCO(loco)
Expand Down
4 changes: 2 additions & 2 deletions EXRAILMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ int RMFT2::onLCCLookup[RMFT2::countLCCLookup];
#define READ_LOCO OPCODE_READ_LOCO1,0,0,OPCODE_READ_LOCO2,0,0,
#define RED(signal_id) OPCODE_RED,V(signal_id),
#define RESERVE(blockid) OPCODE_RESERVE,V(blockid),
#define RESET(pin) OPCODE_RESET,V(pin),
#define RESET(pin,count...) OPCODE_RESET,V(pin),OPCODE_PAD,V(#count[0] ? count+0: 1),
#define RESUME OPCODE_RESUME,0,0,
#define RETURN OPCODE_RETURN,0,0,
#define REV(speed) OPCODE_REV,V(speed),
Expand Down Expand Up @@ -635,7 +635,7 @@ int RMFT2::onLCCLookup[RMFT2::countLCCLookup];
#define SERVO2(id,position,ms) OPCODE_SERVO,V(id),OPCODE_PAD,V(position),OPCODE_PAD,V(PCA9685::Instant),OPCODE_PAD,V(ms/100L),
#define SERVO_SIGNAL(vpin,redpos,amberpos,greenpos)
#define SERVO_TURNOUT(id,pin,activeAngle,inactiveAngle,profile,description...) OPCODE_SERVOTURNOUT,V(id),OPCODE_PAD,V(pin),OPCODE_PAD,V(activeAngle),OPCODE_PAD,V(inactiveAngle),OPCODE_PAD,V(PCA9685::ProfileType::profile),
#define SET(pin) OPCODE_SET,V(pin),
#define SET(pin,count...) OPCODE_SET,V(pin),OPCODE_PAD,V(#count[0] ? count+0: 1),
#define SET_TRACK(track,mode) OPCODE_SET_TRACK,V(TRACK_MODE_##mode <<8 | TRACK_NUMBER_##track),
#define SET_POWER(track,onoff) OPCODE_SET_POWER,V(TRACK_POWER_##onoff),OPCODE_PAD, V(TRACK_NUMBER_##track),
#define SETLOCO(loco) OPCODE_SETLOCO,V(loco),
Expand Down

0 comments on commit 03bd1e8

Please sign in to comment.