Prusa MINI Firmware overview
|
Go to the documentation of this file.
24 #include "../../inc/MarlinConfig.h"
26 #if HAS_FILAMENT_SENSOR
27 #include "../runout.h"
44 #if HAS_LCD_MENU && ENABLED(MMU2_MENUS)
46 static void load_filament(
uint8_t);
47 static void load_all();
48 static bool load_filament_to_nozzle(
uint8_t index);
49 static bool eject_filament(
uint8_t index,
bool recover);
53 static bool rx_str_P(
const char* str);
54 static void tx_str_P(
const char* str);
55 static void tx_printf_P(
const char* format,
int argument);
56 static void tx_printf_P(
const char* format,
int argument1,
int argument2);
57 static void clear_rx_buffer();
60 static bool rx_start();
61 static void check_version();
63 static void command(
const uint8_t cmd);
64 static bool get_response();
65 static void manage_response(
const bool move_axes,
const bool turn_off_nozzle);
67 #if HAS_LCD_MENU && ENABLED(MMU2_MENUS)
68 static void load_to_nozzle();
69 static void filament_ramming();
70 static void execute_extruder_sequence(
const E_Step * sequence,
int steps);
73 static void filament_runout();
75 static bool enabled, ready, mmu_print_saved;
76 static uint8_t cmd, cmd_arg, last_cmd, extruder;
78 static volatile int8_t finda;
79 static volatile bool finda_runout_valid;
80 static int16_t version, buildnr;
81 static millis_t last_request, next_P0_request;
82 static char rx_buffer[16], tx_buffer[16];
84 static inline void set_runout_valid(
const bool valid) {
85 finda_runout_valid = valid;
86 #if HAS_FILAMENT_SENSOR
#define WITHIN(N, L, H)
Definition: macros.h:195
T z
Definition: types.h:286
#define enable_E0()
Definition: Marlin.h:260
#define GET_TEXT(MSG)
Definition: multi_language.h:72
static FORCE_INLINE bool tooColdToExtrude(const uint8_t)
Definition: temperature.h:314
static uint8_t get_current_tool()
static void synchronize()
Definition: planner.cpp:1556
static FORCE_INLINE int16_t degTargetHotend(const uint8_t E_NAME)
Definition: temperature.h:562
#define PROGMEM
Definition: pgmspace.h:29
GCodeQueue queue
Definition: queue.cpp:28
#define LOW
Definition: wiring_constants.h:70
#define DEBUG_EOL()
Definition: debug_out.h:86
#define DEBUG_ECHOLNPGM(...)
Definition: debug_out.h:79
void host_prompt_do(const PromptReason type, const char *const pstr, const char *const pbtn)
Definition: marlin_server.cpp:1103
void do_blocking_move_to_z(const float &rz, const feedRate_t &fr_mm_s)
Definition: motion.cpp:450
uint8_t type
Definition: UsbCore.h:184
void do_blocking_move_to_xy(const float &rx, const float &ry, const feedRate_t &fr_mm_s)
Definition: motion.cpp:454
#define DEBUG_ECHO_F(...)
Definition: debug_out.h:76
T e
Definition: types.h:383
uint8_t i
Definition: screen_test_graph.c:72
#define STRINGIFY(M)
Definition: macros.h:73
void kill(PGM_P const lcd_error, PGM_P const lcd_component, const bool steppers_off)
Definition: Marlin.cpp:718
uint32_t millis(void)
Definition: wiring_time.c:29
#define SET_OUTPUT(IO)
Definition: fastio.h:101
#define DEBUG_ECHOLNPAIR(...)
Definition: debug_out.h:82
#define SERIAL_ECHO_START()
Definition: serial.h:179
#define DEBUG_ECHO_START()
Definition: debug_out.h:72
float feedRate_t
Definition: types.h:80
#define sprintf_P(s,...)
Definition: pgmspace.h:72
#define KEEPALIVE_STATE(N)
Definition: gcode.h:365
#define disable_E0()
Definition: Marlin.h:261
#define strlen_P(s)
Definition: pgmspace.h:61
bool wait_for_user
Definition: Marlin.cpp:188
#define pgm_read_byte(addr)
Definition: pgmspace.h:95
#define PSTR(str)
Definition: pgmspace.h:31
xyze_pos_t current_position
Definition: motion.cpp:102
#define COUNT(a)
Definition: macros.h:200
void line_to_current_position(const feedRate_t &fr_mm_s)
Definition: motion.cpp:285
static void reset()
Definition: runout.h:76
#define WRITE(IO, V)
Definition: fastio.h:96
#define pgm_read_float(addr)
Definition: pgmspace.h:109
#define SERIAL_ECHOLNPAIR(V...)
Definition: serial.h:144
#define ELAPSED(NOW, SOON)
Definition: millis_t.h:29
const uint8_t[]
Definition: 404_html.c:3
#define SERIAL_ERROR_MSG(S)
Definition: serial.h:184
#define HIGH
Definition: wiring_constants.h:71
#define DEC
Definition: Print.h:29
#define DEBUG_ECHOPAIR(...)
Definition: debug_out.h:80
#define MMM_TO_MMS(MM_M)
Definition: types.h:83
void safe_delay(millis_t ms)
Definition: utility.cpp:28
static void inject_P(PGM_P const pgcode)
Definition: queue.cpp:206
static void set_filament_type(uint8_t index, uint8_t type)
#define SERIAL_ECHOLNPGM(S)
Definition: serial.h:174
#define MSG_ACTIVE_EXTRUDER
Definition: language.h:183
Nozzle nozzle
Definition: nozzle.cpp:29
void idle()
Definition: Marlin.cpp:629
Temperature thermalManager
Definition: temperature.cpp:89
uint32_t millis_t
Definition: millis_t.h:26
#define BUZZ(d, f)
Definition: buzzer.h:126
constexpr uint8_t active_extruder
Definition: motion.h:107
static void tool_change(uint8_t index)
Planner planner
Definition: planner.cpp:111
FORCE_INLINE bool all_axes_homed()
Definition: motion.h:44