From 2efcfa16d40ff496ef472cce463d00c0980731de Mon Sep 17 00:00:00 2001 From: Dan Date: Fri, 22 Nov 2024 16:32:41 -0800 Subject: [PATCH] Added compile time check for number of pairs --- VortexEngine/src/Leds/LedTypes.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/VortexEngine/src/Leds/LedTypes.h b/VortexEngine/src/Leds/LedTypes.h index 1405681eb0..73bcce80f3 100644 --- a/VortexEngine/src/Leds/LedTypes.h +++ b/VortexEngine/src/Leds/LedTypes.h @@ -78,6 +78,9 @@ enum Pair : uint8_t PAIR_LAST = (PAIR_COUNT - 1), }; +// Compile-time check on the number of pairs and leds +static_assert(LED_COUNT == (PAIR_COUNT * 2), "Incorrect number of Pairs for Leds! Adjust the Led enum or Pair enum to match"); + // check if an led is even or odd #define isEven(pos) ((pos % 2) == 0) #define isOdd(pos) ((pos % 2) != 0)