1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-12-27 14:21:25 +01:00

one shot DRIVE

UNTESTED
This commit is contained in:
Asbelos 2021-11-25 11:45:45 +00:00
parent 92d6a15ee5
commit a4e94610e6
2 changed files with 3 additions and 5 deletions

View File

@ -683,11 +683,9 @@ void RMFT2::loop2() {
case OPCODE_DRIVE:
{
// IMCOMPLETE TODO PENDING HAL changes for analog read etc
if (readSensor(operand)) break;
byte analogSpeed=IODevice::readAnalogue(GET_OPERAND(1)) *127 / 1024;
if (speedo!=analogSpeed) driveLoco(analogSpeed);
return;
break;
}
case OPCODE_XFON:

View File

@ -63,7 +63,7 @@
#define DEACTIVATE(addr,subaddr)
#define ACTIVATEL(addr)
#define DEACTIVATEL(addr)
#define DRIVE(analogpin,stopper)
#define DRIVE(analogpin)
#define AMBER(signal_id)
#define AT(sensor_id)
#define AUTOSTART
@ -263,7 +263,7 @@ const int StringMacroTracker1=__COUNTER__;
#define DEACTIVATE(addr,subaddr) OPCODE_DCCACTIVATE,V(addr<<3 | subaddr<<1),
#define ACTIVATEL(addr) OPCODE_DCCACTIVATE,V((addr+3)<<3 | 1),
#define DEACTIVATEL(addr) OPCODE_DCCACTIVATE,V((addr+3)<<3),
#define DRIVE(analogpin,stopper) OPCODE_DRIVE,V(stopper),OPCODE_PAD,V(analogpin),
#define DRIVE(analogpin) OPCODE_DRIVE,V(analogpin),
#define AFTER(sensor_id) OPCODE_AT,V(sensor_id),OPCODE_AFTER,V(sensor_id),
#define AMBER(signal_id) OPCODE_AMBER,V(signal_id),
#define AT(sensor_id) OPCODE_AT,V(sensor_id),