From b35ce88fdd807434013e447345317f71e98087a5 Mon Sep 17 00:00:00 2001 From: Asbelos Date: Sun, 22 Aug 2021 17:01:55 +0100 Subject: [PATCH] Deeay long values --- RMFT2.cpp | 6 +++--- RMFTMacros.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/RMFT2.cpp b/RMFT2.cpp index f358a70..d3ffd75 100644 --- a/RMFT2.cpp +++ b/RMFT2.cpp @@ -489,15 +489,15 @@ void RMFT2::loop2() { break; case OPCODE_DELAY: - delayMe(operand*100); + delayMe(operand*100L); break; case OPCODE_DELAYMINS: - delayMe(operand*60*1000); + delayMe(operand*60L*1000L); break; case OPCODE_RANDWAIT: - delayMe((long)random(operand*100)); + delayMe(random(operand)*100L); break; case OPCODE_RED: diff --git a/RMFTMacros.h b/RMFTMacros.h index 7c6c9d2..3e81ee1 100644 --- a/RMFTMacros.h +++ b/RMFTMacros.h @@ -209,9 +209,9 @@ const int StringMacroTracker1=__COUNTER__; #define AT(sensor_id) OPCODE_AT,V(sensor_id), #define CALL(route) OPCODE_CALL,V(route), #define CLOSE(id) OPCODE_CLOSE,V(id), -#define DELAY(ms) OPCODE_DELAY,V(ms/100), +#define DELAY(ms) OPCODE_DELAY,V(ms/100L), #define DELAYMINS(mindelay) OPCODE_DELAYMINS,V(mindelay), -#define DELAYRANDOM(mindelay,maxdelay) OPCODE_DELAY,V(mindelay/100),OPCODE_RANDWAIT,V((maxdelay-mindelay)/100), +#define DELAYRANDOM(mindelay,maxdelay) OPCODE_DELAY,V(mindelay/100L),OPCODE_RANDWAIT,V((maxdelay-mindelay)/100L), #define ENDIF OPCODE_ENDIF,NOP, #define ESTOP OPCODE_SPEED,V(1), #define FOFF(func) OPCODE_FOFF,V(func),