Simple config header with example

pull/39/head
VintagePC 2021-06-30 19:33:38 -04:00
parent ab01413116
commit 4001234e5e
2 changed files with 15 additions and 1 deletions

13
src/config/config.h Normal file
View File

@ -0,0 +1,13 @@
/*
config.h - Wrangler for assorted compile-time configuration and constants.
*/
#pragma once
namespace config {
// Max number of extruders
static constexpr uint8_t tool_count = 5U;
}

View File

@ -1,6 +1,7 @@
#include "permanent_storage.h"
#include "../hal/eeprom.h"
#include "globals.h"
#include "../config/config.h"
#include <stddef.h>
@ -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;