From 2cc73133c462a45e06e00629d17f5d07174dce11 Mon Sep 17 00:00:00 2001 From: kalymos Date: Tue, 24 Feb 2026 22:45:22 +0100 Subject: [PATCH] optimize digital input reading with boolean normalization - Updated all input read macros (PIN_SQCK_READ, PIN_SUBQ_READ, etc.) to use double logical NOT (!!) operators. - This ensures bitwise masks are normalized to a pure 0 or 1 boolean value. - Optimization: Allows the compiler to use faster AVR branch instructions (SBIC/SBIS) and improves compatibility with direct equality tests. - Updated inline documentation for better clarity on bitwise operations. --- PSNee/MCU.h | 91 ++++++++++++++++++++++++------------------------- PSNee/PSNee.ino | 2 +- 2 files changed, 45 insertions(+), 48 deletions(-) diff --git a/PSNee/MCU.h b/PSNee/MCU.h index 054cb64..f637433 100644 --- a/PSNee/MCU.h +++ b/PSNee/MCU.h @@ -49,21 +49,23 @@ //****************************************************************************************************************** -// Example: (PIND & (1<