From 82bd81c29994f73f93af0443fdc419e1a7125e2c Mon Sep 17 00:00:00 2001 From: Dan Date: Mon, 25 Nov 2024 20:51:52 -0800 Subject: [PATCH] restore pair code --- VortexEngine/src/Leds/LedTypes.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/VortexEngine/src/Leds/LedTypes.h b/VortexEngine/src/Leds/LedTypes.h index c5eb8b5cab..64317d3843 100644 --- a/VortexEngine/src/Leds/LedTypes.h +++ b/VortexEngine/src/Leds/LedTypes.h @@ -84,15 +84,15 @@ static_assert(LED_COUNT == (PAIR_COUNT * 2), "Incorrect number of Pairs for Leds #define PAIR_4 PAIR_1 // check if an led is even or odd -#define isEven(pos) (pos < 3) -#define isOdd(pos) (pos >= 3) +#define isEven(pos) ((pos % 2) == 0) +#define isOdd(pos) ((pos % 2) != 0) // convert a pair to even or odd led position -#define pairEven(pair) (LedPos)((uint32_t)pair) -#define pairOdd(pair) (LedPos)(((uint32_t)pair) + 3) +#define pairEven(pair) (LedPos)((uint32_t)pair * 2) +#define pairOdd(pair) (LedPos)(((uint32_t)pair * 2) + 1) // convert an led position to a pair -#define ledToPair(pos) (Pair)((uint32_t)pos >= 3 ? 1 : 0) +#define ledToPair(pos) (Pair)((uint32_t)pos / 2) // LedMap is a bitmap of leds, used for expressing whether to turn certain leds on // or off with a single integer