Skip to content

Commit

Permalink
EXTAIL AFTER debounce time
Browse files Browse the repository at this point in the history
  • Loading branch information
Asbelos committed Jul 10, 2024
1 parent 60e564d commit 96c4757
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
8 changes: 5 additions & 3 deletions EXRAIL2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,14 +628,16 @@ void RMFT2::loop2() {
skipIf=blinkState!=at_timeout;
break;

case OPCODE_AFTER: // waits for sensor to hit and then remain off for 0.5 seconds. (must come after an AT operation)
case OPCODE_AFTER: // waits for sensor to hit and then remain off for x mS.
// Note, this must come after an AT operation, which is
// automatically inserted by the AFTER macro.
if (readSensor(operand)) {
// reset timer to half a second and keep waiting
// reset timer and keep waiting
waitAfter=millis();
delayMe(50);
return;
}
if (millis()-waitAfter < 500 ) return;
if (millis()-waitAfter < getOperand(1) ) return;
break;

case OPCODE_AFTEROVERLOAD: // waits for the power to be turned back on - either by power routine or button
Expand Down
2 changes: 1 addition & 1 deletion EXRAIL2MacroReset.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
#ifndef RMFT2_UNDEF_ONLY
#define ACTIVATE(addr,subaddr)
#define ACTIVATEL(addr)
#define AFTER(sensor_id)
#define AFTER(sensor_id,timer...)
#define AFTEROVERLOAD(track_id)
#define ALIAS(name,value...)
#define AMBER(signal_id)
Expand Down
2 changes: 1 addition & 1 deletion EXRAILMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ int RMFT2::onLCCLookup[RMFT2::countLCCLookup];

#define ACTIVATE(addr,subaddr) OPCODE_DCCACTIVATE,V(addr<<3 | subaddr<<1 | 1),
#define ACTIVATEL(addr) OPCODE_DCCACTIVATE,V((addr+3)<<1 | 1),
#define AFTER(sensor_id) OPCODE_AT,V(sensor_id),OPCODE_AFTER,V(sensor_id),
#define AFTER(sensor_id,timer...) OPCODE_AT,V(sensor_id),OPCODE_AFTER,V(sensor_id),OPCODE_PAD,V(#timer[0]?timer+0:500),
#define AFTEROVERLOAD(track_id) OPCODE_AFTEROVERLOAD,V(TRACK_NUMBER_##track_id),
#define ALIAS(name,value...)
#define AMBER(signal_id) OPCODE_AMBER,V(signal_id),
Expand Down
5 changes: 4 additions & 1 deletion version.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@

#include "StringFormatter.h"

#define VERSION "5.2.66"
#define VERSION "5.2.67"
// 5.2.67 - EXRAIL AFTER optional debounce time variable (default 500mS)
// - AFTER(42) == AFTER(42,500) sets time sensor must
// - be continuously off.
// 5.2.66 - <F cab DCFREQ 0..3>
// - EXRAIL SETFREQ drop loco param (breaking since 5.2.28)
// 5.2.65 - Speedup Exrail SETFREQ
Expand Down

0 comments on commit 96c4757

Please sign in to comment.