From a4e94610e65b9359b04f199d234289d99a125f9e Mon Sep 17 00:00:00 2001 From: Asbelos Date: Thu, 25 Nov 2021 11:45:45 +0000 Subject: [PATCH] one shot DRIVE UNTESTED --- RMFT2.cpp | 4 +--- RMFTMacros.h | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/RMFT2.cpp b/RMFT2.cpp index 7d96118..5fb9049 100644 --- a/RMFT2.cpp +++ b/RMFT2.cpp @@ -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: diff --git a/RMFTMacros.h b/RMFTMacros.h index 5395725..60c6fa1 100644 --- a/RMFTMacros.h +++ b/RMFTMacros.h @@ -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),