From ad6c1384c919a2a590f6b3c24f9c3b8eb0e88c0f Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Mon, 5 Sep 2022 09:02:35 +0200 Subject: [PATCH] EXRAIL bugfix, protect RANDWAIT from division by zero. Triggered by DELAYRANDOM(X, X+99) or less diff --- EXRAIL2.cpp | 2 +- GITHUB_SHA.h | 2 +- version.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/EXRAIL2.cpp b/EXRAIL2.cpp index 30b1b6d..fb6c9ac 100644 --- a/EXRAIL2.cpp +++ b/EXRAIL2.cpp @@ -750,7 +750,7 @@ void RMFT2::loop2() { break; case OPCODE_RANDWAIT: - delayMe((micros()%operand) *100L); + delayMe(operand==0 ? 0 : (micros()%operand) *100L); break; case OPCODE_RED: diff --git a/GITHUB_SHA.h b/GITHUB_SHA.h index 85abd54..cf63b2e 100644 --- a/GITHUB_SHA.h +++ b/GITHUB_SHA.h @@ -1 +1 @@ -#define GITHUB_SHA "PORTX-HAL-20220830" +#define GITHUB_SHA "PORTX-HAL-20220905" diff --git a/version.h b/version.h index b4e4690..9a6bd5f 100644 --- a/version.h +++ b/version.h @@ -4,7 +4,7 @@ #include "StringFormatter.h" -#define VERSION "4.2.4 rc1" +#define VERSION "4.2.4 rc2" // 4.2.4 ESP32 experimental BT support // More DC configurations possible and lower frequency // 4.2.3 Bugfix direction when togging between MAIN and DC