Skip to content

Commit 312b841

Browse files
committed
Asked GitHub Copilot for static_asset ideas
1 parent 2592a36 commit 312b841

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

include/CommonConfig.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ namespace LOAD {
5858
* @brief Number of load pins available.
5959
*/
6060
constexpr uint_fast8_t NUM_PINS = 6;
61+
static_assert(NUM_PINS <= 8, "We only have 8 pins available");
6162

6263
/**
6364
* @brief Total number of possible pin combinations (2^NUM_PINS).
@@ -264,6 +265,11 @@ namespace LOAD {
264265
detail::deduplicateSortedArray<NUM_COMBINATIONS,
265266
NUM_UNIQUE_COMBINATIONS>(
266267
ALL_COMBINATIONS_mOhms);
268+
static_assert(NUM_UNIQUE_COMBINATIONS > 0,
269+
"There must be at least one unique combination");
270+
static_assert(UNIQUE_COMBINATIONS_mOhms[0] == 0,
271+
"Zero-resistance combination (mask 0) must be present "
272+
"and the minimum value");
267273

268274
/**
269275
* @brief Index of the pin that is connected (logical 1) by default.

0 commit comments

Comments
 (0)