From 940446e7c989413a094ab5ed229484ea898a5c28 Mon Sep 17 00:00:00 2001 From: tx_haggis <13982343+adbancroft@users.noreply.github.com> Date: Sat, 30 Nov 2024 16:59:19 -0600 Subject: [PATCH] MISRA fixes --- speeduino/globals.h | 66 ++++++++++++++++++++---------------------- speeduino/maths.cpp | 2 +- speeduino/pw_calcs.cpp | 4 +-- 3 files changed, 35 insertions(+), 37 deletions(-) diff --git a/speeduino/globals.h b/speeduino/globals.h index e3b48bcbb5..71f130fe43 100644 --- a/speeduino/globals.h +++ b/speeduino/globals.h @@ -40,10 +40,10 @@ #define CORE_AVR #define BOARD_H "board_avr2560.h" #ifndef INJ_CHANNELS - #define INJ_CHANNELS 4 + #define INJ_CHANNELS 4U #endif #ifndef IGN_CHANNELS - #define IGN_CHANNELS 5 + #define IGN_CHANNELS 5U #endif #if defined(__AVR_ATmega2561__) @@ -116,8 +116,6 @@ #define CRANK_ANGLE_MAX (max(CRANK_ANGLE_MAX_IGN, CRANK_ANGLE_MAX_INJ)) -#define interruptSafe(c) (noInterrupts(); {c} interrupts();) //Wraps any code between nointerrupt and interrupt calls - #define MICROS_PER_SEC INT32_C(1000000) #define MICROS_PER_MIN INT32_C(MICROS_PER_SEC*60U) #define MICROS_PER_HOUR INT32_C(MICROS_PER_MIN*60U) @@ -225,17 +223,17 @@ static_assert(TOOTH_LOG_SIZE= (uint8_t)(index)) ? pw : 0U; + current.PW ## index = ((current.maxInjOutputs) >= (uint8_t)(index)) ? (pw) : 0U; // The PW calcs already applied the logic to enable staging or not. If there is a valid // secondary PW, staging is enabled