Prusa3d Marlin fork
|
New MMU2 protocol logic.
Classes | |
struct | ReportingRAII |
struct | Version |
class | MMU2 |
struct | pos3d |
@TODO hmmm, 12 bytes... may be we can reduce that More... | |
struct | OldMMUFWDetector |
class | DropOutFilter |
Filter of short consecutive drop outs which are recovered instantly. More... | |
class | ProtocolLogic |
Logic layer of the MMU vs. printer communication protocol. More... | |
struct | TuneItem |
struct | _menu_tune_data_t |
struct | TryLoadUnloadReporter |
class | MMU2Serial |
A minimal serial interface for the MMU. More... | |
Enumerations | |
enum | : uint8_t { FILAMENT_UNKNOWN = 0xffU } |
enum class | FilamentState : uint_fast8_t { NOT_PRESENT = 0 , AT_FSENSOR = 1 , IN_NOZZLE = 2 , UNAVAILABLE = 3 } |
enum | StepStatus : uint_fast8_t { Processing = 0 , MessageReady , Finished , Interrupted , CommunicationTimeout , ProtocolError , CommandRejected , CommandError , VersionMismatch , PrinterError , CommunicationRecovered , ButtonPushed } |
ProtocolLogic stepping statuses. More... | |
enum class | ReportErrorHookStates : uint8_t { RENDER_ERROR_SCREEN = 0 , MONITOR_SELECTION = 1 , DISMISS_ERROR_SCREEN = 2 } |
enum | CommandInProgress : uint8_t { NoCommand = 0 , CutFilament = 'K' , EjectFilament = 'E' , Homing = 'H' , LoadFilament = 'L' , Reset = 'X' , ToolChange = 'T' , UnloadFilament = 'U' } |
enum | SoundType { Prompt = 2 , Confirm = 3 } |
enum class | xState : uint_fast8_t { Active , Connecting , Stopped } |
Functions | |
template<typename F > | |
void | waitForHotendTargetTemp (uint16_t delay, F f) |
void | WaitForHotendTargetTempBeep () |
bool | __attribute__ ((noinline)) MMU2 |
template<class InputIt , class UnaryPredicate > | |
constexpr InputIt | find_if_cx (InputIt first, InputIt last, UnaryPredicate p) |
static constexpr uint8_t | FindErrorIndex (uint16_t pec) |
constexpr ErrorCode | operator& (ErrorCode a, ErrorCode b) |
constexpr bool | ContainsBit (ErrorCode ec, ErrorCode mask) |
uint8_t | PrusaErrorCodeIndex (ErrorCode ec) |
uint16_t | PrusaErrorCode (uint8_t i) |
const char * | PrusaErrorTitle (uint8_t i) |
const char * | PrusaErrorDesc (uint8_t i) |
uint8_t | PrusaErrorButtons (uint8_t i) |
const char * | PrusaErrorButtonTitle (uint8_t bi) |
const char * | PrusaErrorButtonMore () |
Buttons | ButtonPressed (ErrorCode ec) |
Buttons | ButtonAvailable (ErrorCode ec) |
void | SetButtonResponse (ButtonOperations rsp) |
FilamentState | WhereIsFilament () |
void | LogErrorEvent_P (const char *msg) |
void | LogEchoEvent_P (const char *msg) |
void | extruder_move (float distance, float feed_rate) |
void | extruder_schedule_turning (float feed_rate) |
float | move_raise_z (float delta) |
void | planner_abort_queued_moves () |
void | planner_synchronize () |
bool | planner_any_moves () |
float | stepper_get_machine_position_E_mm () |
float | planner_get_current_position_E () |
void | planner_set_current_position_E (float e) |
pos3d | planner_current_position () |
void | motion_do_blocking_move_to_xy (float rx, float ry, float feedRate_mm_s) |
void | motion_do_blocking_move_to_z (float z, float feedRate_mm_s) |
void | nozzle_park () |
bool | marlin_printingIsActive () |
void | marlin_manage_heater () |
void | marlin_manage_inactivity (bool b) |
void | marlin_idle (bool b) |
void | marlin_refresh_print_state_in_ram () |
void | marlin_clear_print_state_in_ram () |
void | marlin_stop_and_save_print_to_ram () |
int16_t | thermal_degTargetHotend () |
int16_t | thermal_degHotend () |
void | thermal_setExtrudeMintemp (int16_t t) |
void | thermal_setTargetHotend (int16_t t) |
void | safe_delay_keep_alive (uint16_t t) |
void | Enable_E0 () |
void | Disable_E0 () |
bool | all_axes_homed () |
static void | planner_line_to_current_position (float feedRate_mm_s) |
static void | planner_line_to_current_position_sync (float feedRate_mm_s) |
float | planner_get_machine_position_E_mm () |
void | power_on () |
void | power_off () |
void | reset () |
const char * | ProgressCodeToText (ProgressCode pc) |
constexpr char | NibbleToChar (uint8_t c) |
void | BeginReport (CommandInProgress cip, ProgressCode ec) |
Called at the begin of every MMU operation. | |
void | EndReport (CommandInProgress cip, ProgressCode ec) |
Called at the end of every MMU operation. | |
void | ReportErrorHookDynamicRender (void) |
Renders any characters that will be updated live on the MMU error screen. Currently, this is FINDA and Filament Sensor status and Extruder temperature. More... | |
static void | ReportErrorHookStaticRender (uint8_t ei) |
Renders any characters that are static on the MMU error screen i.e. they don't change. More... | |
void | ReportErrorHookSensorLineRender () |
Renders the static part of the sensor state line. Also used by "resuming temperature screen". | |
static uint8_t | ReportErrorHookMonitor (uint8_t ei) |
Monitors the LCD button selection without blocking MMU communication. More... | |
void | CheckErrorScreenUserInput () |
Checks for error screen user input, if the error screen is open. | |
bool | TuneMenuEntered () |
void | ReportErrorHook (CommandInProgress cip, ErrorCode ec, uint8_t es) |
Called when the MMU or MK3S sends operation error (even repeatedly). Render MMU error screen on the LCD. This must be non-blocking and allow the MMU and printer to communicate with each other. More... | |
void | ReportProgressHook (CommandInProgress cip, ProgressCode ec) |
Called when the MMU sends operation progress update. | |
void | DisableMMUInSettings () |
Disables MMU in EEPROM. | |
void | IncrementLoadFails () |
void | IncrementMMUFails () |
Increments EEPROM cell - number of MMU errors. | |
bool | cutter_enabled () |
void | MakeSound (SoundType s) |
static void | FullScreenMsg (const char *pgmS, uint8_t slot) |
void | FullScreenMsgCut (uint8_t slot) |
void | FullScreenMsgEject (uint8_t slot) |
void | FullScreenMsgTest (uint8_t slot) |
void | FullScreenMsgLoad (uint8_t slot) |
void | FullScreenMsgRestoringTemperature () |
void | ScreenUpdateEnable () |
void | ScreenClear () |
struct MMU2::TuneItem | __attribute__ ((packed)) |
void | tuneIdlerStallguardThresholdMenu () |
void | tuneIdlerStallguardThreshold () |
bool | MMUAvailable () |
bool | UseMMU () |
Global Enable/Disable use MMU (to be stored in EEPROM) | |
Variables | |
MMU2 | mmu2 |
static ButtonOperations | buttonSelectedOperation = ButtonOperations::NoOperation |
static const char MSG_PROGRESS_OK[] | PROGMEM_I1 = ISTR("OK") |
static const char *const progressTexts[] | PROGMEM |
static constexpr uint8_t supportedMmuFWVersion[3] | PROGMEM = { mmuVersionMajor, mmuVersionMinor, mmuVersionPatch } |
static constexpr uint8_t | MAX_RETRIES = 3U |
constexpr uint32_t | linkLayerTimeout = 2000 |
default link layer communication timeout | |
constexpr uint32_t | dataLayerTimeout = linkLayerTimeout * 3 |
data layer communication timeout | |
constexpr uint32_t | heartBeatPeriod = linkLayerTimeout / 2 |
period of heart beat messages (Q0) | |
enum ReportErrorHookStates | ReportErrorHookState = ReportErrorHookStates::RENDER_ERROR_SCREEN |
static bool | is_mmu_error_monitor_active |
static bool | putErrorScreenToSleep |
static const TuneItem TuneItems[] | PROGMEM |
struct MMU2::_menu_tune_data_t | __attribute__ |
MMU2Serial | mmu2Serial |
static constexpr uint8_t | mmuVersionMajor = 3 |
static constexpr uint8_t | mmuVersionMinor = 0 |
static constexpr uint8_t | mmuVersionPatch = 2 |
|
strong |
Possible states of filament from the perspective of presence in various parts of the printer Beware, the numeric codes are important and sent into the MMU
enum MMU2::StepStatus : uint_fast8_t |
|
strong |
States of a printer with the MMU:
When the printer's FW starts, the MMU mode is either Stopped or NotResponding (based on user's preference). When the MMU successfully establishes communication, the state changes to Active.
Buttons MMU2::MMU2::ButtonAvailable | ( | ErrorCode | ec | ) |
Buttons MMU2::MMU2::ButtonPressed | ( | ErrorCode | ec | ) |
bool MMU2::MMU2::cutter_enabled | ( | ) |
void MMU2::MMU2::IncrementLoadFails | ( | ) |
Increments EEPROM cell - number of failed loads into the nozzle Note: technically, this is not an MMU error but an error of the printer.
void MMU2::MMU2::LogEchoEvent_P | ( | const char * | msg_P | ) |
Report the msg into the general logging subsystem (through Marlin's SERIAL_ECHO stuff)
msg | pointer to a string in PROGMEM On the AVR platform this variant reads the input string from PROGMEM. On the ARM platform it calls LogErrorEvent directly (silently expecting the compiler to optimize it away) |
void MMU2::MMU2::LogErrorEvent_P | ( | const char * | msg_P | ) |
Report the msg into the general logging subsystem (through Marlin's SERIAL_ECHO stuff)
msg | pointer to a string in PROGMEM On the AVR platform this variant reads the input string from PROGMEM. On the ARM platform it calls LogErrorEvent directly (silently expecting the compiler to optimize it away) |
bool MMU2::MMUAvailable | ( | ) |
const char * MMU2::MMU2::PrusaErrorButtonMore | ( | ) |
uint8_t MMU2::MMU2::PrusaErrorButtons | ( | uint8_t | i | ) |
i | index of the error - obtained by calling ErrorCodeIndex |
const char * MMU2::MMU2::PrusaErrorButtonTitle | ( | uint8_t | bi | ) |
i | index of the error - obtained by calling PrusaErrorButtons + extracting low or high nibble from the Btns pair |
uint16_t MMU2::MMU2::PrusaErrorCode | ( | uint8_t | i | ) |
i | index of the error - obtained by calling ErrorCodeIndex |
uint8_t MMU2::MMU2::PrusaErrorCodeIndex | ( | ErrorCode | ec | ) |
Translates MMU2::ErrorCode into an index of Prusa-Error-Codes Basically this is the way to obtain an index into all other functions in this API
const char * MMU2::MMU2::PrusaErrorDesc | ( | uint8_t | i | ) |
i | index of the error - obtained by calling ErrorCodeIndex |
const char * MMU2::MMU2::PrusaErrorTitle | ( | uint8_t | i | ) |
i | index of the error - obtained by calling ErrorCodeIndex |
void MMU2::MMU2::ReportErrorHook | ( | CommandInProgress | cip, |
ErrorCode | ec, | ||
uint8_t | es | ||
) |
[in] | ec | error code |
[in] | es | error source |
void MMU2::MMU2::ReportErrorHookDynamicRender | ( | void | ) |
Remders the sensor status line. Also used by the "resume temperature" screen.
|
static |
[in] | ei | Error code index |
Button menu
|
static |
[in] | ei | Error code index |
Show an error screen When an MMU error occurs, the LCD content will look like this: |01234567890123456789| |MMU FW update needed| <- title/header of the error: max 20 characters |prusa.io/04504 | <- URL max 20 characters |FI:1 FS:1 5>3 t201°| <- status line, t is thermometer symbol |>Retry >Done >W| <- buttons
void MMU2::MMU2::SetButtonResponse | ( | ButtonOperations | rsp | ) |
Sets the selected button for later pick-up by the MMU state machine. Used to save the GUI selection/decoupling
bool MMU2::MMU2::TuneMenuEntered | ( | ) |
Return true if the error screen is sleeping in the background Error screen sleeps when the firmware is rendering complementary UI to resolve the error screen, for example tuning Idler Stallguard Threshold
MMU2 MMU2::MMU2::mmu2 |
following Marlin's way of doing stuff - one and only instance of MMU implementation in the code base
|
staticconstexpr |
Beware - on AVR/MK3S: Changing the supportedMmuVersion numbers requires patching MSG_DESC_FW_UPDATE_NEEDED and all its related translations by hand.
The message reads: "MMU FW version is incompatible with printer FW.Update to version 2.1.9."
Currently, this is not possible to perform automatically at compile time with the existing languages/translations infrastructure. To save space a "dumb" solution was chosen + a few static_assert checks in errors_list.h preventing the code from compiling when the string doesn't match.
|
static |