diff --git a/src/config/config.h b/src/config/config.h new file mode 100644 index 0000000..a176534 --- /dev/null +++ b/src/config/config.h @@ -0,0 +1,10 @@ +#pragma once +#include + +/// Wrangler for assorted compile-time configuration and constants. +namespace config { + +/// Max number of extruders +static constexpr uint8_t tool_count = 5U; + +} // namespace config diff --git a/src/modules/permanent_storage.cpp b/src/modules/permanent_storage.cpp index d21eb2d..1c23542 100644 --- a/src/modules/permanent_storage.cpp +++ b/src/modules/permanent_storage.cpp @@ -1,6 +1,7 @@ #include "permanent_storage.h" #include "../hal/eeprom.h" #include "globals.h" +#include "../config/config.h" #include @@ -18,7 +19,7 @@ namespace permanent_storage { /// needs to be changed to force an EEPROM erase. struct eeprom_t { uint8_t eepromLengthCorrection; ///< Legacy bowden length correction - uint16_t eepromBowdenLen[5]; ///< Bowden length for each filament + uint16_t eepromBowdenLen[config::tool_count]; ///< Bowden length for each filament uint8_t eepromFilamentStatus[3]; ///< Majority vote status of eepromFilament wear leveling uint8_t eepromFilament[800]; ///< Top nibble status, bottom nibble last filament loaded uint8_t eepromDriveErrorCountH;