Prusa-MMU-Private
PrusaMultiMaterialUpgradev3firmwareforMK3SMK4
Classes | Namespaces | Macros | Functions | Variables
permanent_storage.cpp File Reference
#include "permanent_storage.h"
#include "../hal/eeprom.h"
#include "globals.h"
#include "../config/config.h"
#include "axisunit.h"
#include <stddef.h>
Include dependency graph for permanent_storage.cpp:

Classes

struct  modules::permanent_storage::eeprom_t
 EEPROM data layout. More...
 

Namespaces

 modules
 The modules namespace contains models of MMU's components.
 
 modules::permanent_storage
 The permanent_storage namespace provides all necessary facilities related to permanently storing data (into EEPROM) on the MMU unit.
 

Macros

#define ARR_SIZE(ARRAY)   (sizeof(ARRAY) / sizeof(ARRAY[0]))
 
#define EEOFFSET(x)   reinterpret_cast<ee::EEPROM::addr_t>(&(x))
 

Functions

struct modules::permanent_storage::eeprom_t modules::permanent_storage::__attribute__ ((packed))
 
void modules::permanent_storage::Init ()
 Initialization of the permanent storage hive.
 
void modules::permanent_storage::EraseAll ()
 Erase the whole EEPROM.
 
static constexpr bool modules::permanent_storage::validBowdenLen (const uint16_t BowdenLength)
 Is bowden length in valid range? More...
 

Variables

uint8_t eepromLengthCorrection
 pre-MMU Legacy bowden length correction - not used
 
uint16_t eepromBowdenLen [config::toolCount]
 MMU Bowden length for each filament - not used.
 
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
 
uint8_t eepromDriveErrorCountL [2]
 
uint8_t sg_thrs [3]
 
uint16_t bowdenLengthMM
 MMU3 default bowden length in millimeters.
 
static const uint8_t modules::permanent_storage::layoutVersion = 0xff
 EEPROM layout version.
 
static eeprom_t *const modules::permanent_storage::eepromBase = reinterpret_cast<eeprom_t *>(0)
 First EEPROM address.
 
constexpr const uint16_t modules::permanent_storage::eepromEmpty = 0xffffU
 EEPROM content when erased.
 
constexpr const uint16_t modules::permanent_storage::eepromBowdenLenDefault = config::defaultBowdenLength.v
 Default bowden length (~360 mm)
 
constexpr const uint16_t modules::permanent_storage::eepromBowdenLenMinimum = config::minimumBowdenLength.v
 Minimum bowden length (~341 mm)
 
constexpr const uint16_t modules::permanent_storage::eepromBowdenLenMaximum = config::maximumBowdenLength.v
 Maximum bowden length (~1000 mm)