From 8017555ea3ec07cf93be6a4b02dc2c7d1083a599 Mon Sep 17 00:00:00 2001 From: Terry Moore Date: Fri, 22 Nov 2024 09:57:18 -0500 Subject: [PATCH] #968: further workaround to defeat optimization --- src/lmic/lmic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lmic/lmic.c b/src/lmic/lmic.c index 6323fdb6..e16816fd 100644 --- a/src/lmic/lmic.c +++ b/src/lmic/lmic.c @@ -2608,7 +2608,8 @@ static void engineUpdate_inner (void) { // otherwise the compiler falsely assumes that the computation // is positive. // - if( ((ostime_t) (txbeg - (now + TX_RAMPUP))) < 0 ) { + volatile ostime_t tdiff = txbeg - (now + TX_RAMPUP); + if( tdiff < 0 ) { // We could send right now! txbeg = now; dr_t txdr = (dr_t)LMIC.datarate;