4 #include "../config/config.h"
29 "incorrect order of Slot Filament Load States");
68 void SetFSensorToNozzle_mm(uint8_t fss2Nozzle_mm) { fsensorToNozzle_mm = fss2Nozzle_mm; }
72 void SetFSensorUnloadCheck_mm(uint8_t fs2UnlCheck_mm) { fsensorUnloadCheck_mm = fs2UnlCheck_mm; }
76 void SetPulleyLoadFeedrate_mm_s(uint16_t pulleyLoadFR_mm_s) { pulleyLoadFeedrate_mm_s = pulleyLoadFR_mm_s; }
79 void ResetPulleySlowFeedrate() { pulleySlowFeedrate_mm_s = config::pulleySlowFeedrate.v; }
80 void SetPulleySlowFeedrate_mm_s(uint16_t pulleySlowFR_mm_s) { pulleySlowFeedrate_mm_s = pulleySlowFR_mm_s; }
83 void ResetPulleyUnloadFeedrate() { pulleyUnloadFeedrate_mm_s = config::pulleyUnloadFeedrate.v; }
84 void SetPulleyUnloadFeedrate_mm_s(uint16_t pulleyUnloadFR_mm_s) { pulleyUnloadFeedrate_mm_s = pulleyUnloadFR_mm_s; }
87 void ResetSelectorFeedrate() { selectorFeedrate_mm_s = config::selectorFeedrate.v; }
88 void SetSelectorFeedrate_mm_s(uint16_t selectorFR_mm_s) { selectorFeedrate_mm_s = selectorFR_mm_s; }
91 void ResetIdlerFeedrate() { idlerFeedrate_deg_s = config::idlerFeedrate.v; }
92 void SetIdlerFeedrate_deg_s(uint16_t idlerFR_deg_s) { idlerFeedrate_deg_s = idlerFR_deg_s; }
95 void ResetSelectorHomingFeedrate() { selectorHomingFeedrate_mm_s = config::selectorHomingFeedrate.v; }
96 void SetSelectorHomingFeedrate_mm_s(uint16_t selectorFR_mm_s) { selectorHomingFeedrate_mm_s = selectorFR_mm_s; }
99 void ResetIdlerHomingFeedrate() { idlerHomingFeedrate_deg_s = config::idlerHomingFeedrate.v; }
100 void SetIdlerHomingFeedrate_deg_s(uint16_t idlerFR_deg_s) { idlerHomingFeedrate_deg_s = idlerFR_deg_s; }
110 void SetCutIRunCurrent(uint8_t v) { cutIRunCurrent = v; }
113 void ResetCutLength() { cutLength_mm = config::cutLength.v; }
114 void SetCutLength(uint8_t v) { cutLength_mm = v; }
120 void SetActiveSlot(uint8_t newActiveSlot);
125 uint8_t fsensorToNozzle_mm;
126 uint8_t fsensorUnloadCheck_mm;
128 uint16_t pulleyLoadFeedrate_mm_s;
129 uint16_t pulleySlowFeedrate_mm_s;
130 uint16_t pulleyUnloadFeedrate_mm_s;
132 uint16_t selectorFeedrate_mm_s;
133 uint16_t selectorHomingFeedrate_mm_s;
135 uint16_t idlerFeedrate_deg_s;
136 uint16_t idlerHomingFeedrate_deg_s;
138 uint8_t cutIRunCurrent;
139 uint8_t cutLength_mm;
Globals keep track of global state variables in the firmware.
Definition: globals.h:32
FilamentLoadState FilamentLoaded() const
Definition: globals.cpp:50
bool MotorsStealth() const
Definition: globals.h:64
uint8_t ActiveSlot() const
Definition: globals.cpp:42
void SetMotorsMode(bool stealth)
Definition: globals.cpp:80
void SetFilamentLoaded(uint8_t slot, FilamentLoadState newFilamentLoaded)
uint16_t DriveErrors() const
Definition: globals.cpp:72
void SetStallGuardThreshold(config::Axis axis, uint8_t sgthrs)
Stores the new StallGuard threshold for an axis into EEPROM (does not affect the current state of TMC...
Definition: globals.cpp:91
uint8_t StallGuardThreshold(config::Axis axis) const
Definition: globals.cpp:85
uint8_t CutIRunCurrent() const
Definition: globals.h:108
void IncDriveErrors()
Increment MMU errors by 1.
Definition: globals.cpp:76
void Init()
Initializes the global storage hive - basically looks into EEPROM to gather information.
Definition: globals.cpp:12
static constexpr U_mm_s pulleyLoadFeedrate
Definition: config.h:131
static constexpr U_mm fsensorUnloadCheckDistance
Check the state of FSensor after this amount of filament got (hopefully) pulled out while unloading.
Definition: config.h:108
static constexpr uint8_t selectorCutIRun
660mA
Definition: config.h:146
static constexpr U_mm fsensorToNozzle
~20mm from MK4's filament sensor through extruder gears into nozzle
Definition: config.h:105
Axis
List of available axes.
Definition: axis.h:35
The globals namespace provides all necessary facilities related to keeping track of global state of t...
Definition: globals.cpp:8
Globals globals
The one and only instance of global state variables.
Definition: globals.cpp:10
FilamentLoadState
Definition: globals.h:15
@ AtPulley
loaded to mmu (idler and pulley can grab it)
Definition: globals.h:17
@ InFSensor
'f1' loaded into printer's filament sensor
Definition: globals.h:19
@ InNozzle
'f2' loaded into printer's nozzle
Definition: globals.h:20
@ InSelector
'P1' loaded in selector (i.e. unsure where the filament is while doing some operation)
Definition: globals.h:18
@ NotLoaded
not loaded in the MMU at all
Definition: globals.h:16
The modules namespace contains models of MMU's components.
Definition: command_base.h:8
Generic unit type for compile-time conformability testing.
Definition: unit.h:42