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),