Simple config header with example (#39)

Simple config header with example
pull/40/head
vintagepc 2021-07-01 00:47:40 -04:00 committed by GitHub
parent ab01413116
commit e2ec745286
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

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

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

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;