Skip to content

Commit

Permalink
Added compile time check for number of pairs
Browse files Browse the repository at this point in the history
  • Loading branch information
Unreal-Dan committed Nov 23, 2024
1 parent 4285fe0 commit 2efcfa1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions VortexEngine/src/Leds/LedTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2efcfa1

Please sign in to comment.