Prusa MINI Firmware overview
|
Go to the documentation of this file.
24 #include "../inc/MarlinConfig.h"
26 #if ENABLED(EEPROM_SETTINGS)
27 #include "../HAL/shared/persistent_store_api.h"
39 #if ENABLED(EEPROM_SETTINGS)
40 const bool success =
save();
41 #if ENABLED(EEPROM_CHITCHAT)
50 #if ENABLED(SD_FIRMWARE_UPDATE)
51 static bool sd_update_status();
52 static bool set_sd_update_status(
const bool enable);
55 #if ENABLED(EEPROM_SETTINGS)
61 static bool loaded =
false;
62 if (!loaded &&
load()) loaded =
true;
65 #if ENABLED(AUTO_BED_LEVELING_UBL) // Eventually make these available if any leveling system
67 static uint16_t meshes_start_index();
68 FORCE_INLINE static uint16_t meshes_end_index() {
return meshes_end; }
69 static uint16_t calc_num_meshes();
70 static int mesh_slot_offset(
const int8_t slot);
71 static void store_mesh(
const int8_t slot);
72 static void load_mesh(
const int8_t slot,
void *
const into=
nullptr);
84 #if DISABLED(DISABLE_M503)
85 static void report(
const bool forReplay=
false);
88 static void report(
const bool=
false) {}
92 static void postprocess();
94 #if ENABLED(EEPROM_SETTINGS)
96 static bool eeprom_error, validating;
98 #if ENABLED(AUTO_BED_LEVELING_UBL) // Eventually make these available if any leveling system
100 static const uint16_t meshes_end;
105 static bool size_error(
const uint16_t
size);
xy_int_t bilinear_grid_spacing
Definition: configuration_store.cpp:195
#define WITHIN(N, L, H)
Definition: macros.h:195
T z
Definition: types.h:286
#define SERIAL_CHAR(x)
Definition: serial.h:69
skew_factor_t planner_skew_factor
Definition: configuration_store.cpp:309
png_uint_32 crc
Definition: png.c:2247
float delta_segments_per_second
float z2_endstop_adj
Definition: configuration_store.cpp:230
#define DEFAULT_EJERK
Definition: Configuration_A3ides_2209_MINI.h:733
struct SettingsDataStruct SettingsData
bool planner_leveling_active
Definition: configuration_store.cpp:205
Definition: configuration_store.cpp:138
#define EEPROM_OFFSET
Definition: configuration_store.cpp:41
T a
Definition: types.h:287
uint16_t E1
Definition: configuration_store.cpp:119
#define DUMMY_PID_VALUE
Definition: temperature.h:69
bool Z2
Definition: configuration_store.cpp:122
tmc_stepper_current_t tmc_stepper_current
Definition: configuration_store.cpp:286
Definition: planner.h:196
uint16_t crc
Definition: configuration_store.cpp:140
Definition: configuration_store.cpp:122
bool E4
Definition: configuration_store.cpp:122
#define DEFAULT_MAX_ACCELERATION
Definition: Configuration_A3ides_2209_MINI.h:696
float Ki
Definition: temperature.h:57
bool parser_volumetric_enabled
Definition: configuration_store.cpp:280
uint32_t E2
Definition: configuration_store.cpp:120
feedRate_t min_feedrate_mm_s
Definition: planner.h:186
int16_t ui_preheat_hotend_temp[2]
Definition: configuration_store.cpp:239
T x
Definition: types.h:286
void report_M92(const bool echo=true, const int8_t e=-1)
Definition: M92.cpp:26
static bool write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc)
bool X2
Definition: configuration_store.cpp:122
feedRate_t max_feedrate_mm_s[XYZE_N]
Definition: planner.h:182
constexpr xyz_pos_t probe_offset
Definition: probe.h:58
bool E2
Definition: configuration_store.cpp:122
static matrix_3x3 bed_level_matrix
Definition: planner.h:278
tmc_stealth_enabled_t tmc_stealth_enabled
Definition: configuration_store.cpp:289
Definition: L6470_Marlin.h:30
Definition: L6470_Marlin.h:30
MarlinSettings settings
Definition: configuration_store.cpp:344
#define PREHEAT_1_TEMP_BED
Definition: Configuration_A3ides_2209_MINI.h:1379
float backlash_smoothing_mm
Definition: configuration_store.cpp:330
static const uint32_t _DMA[] PROGMEM
Definition: configuration_store.cpp:128
list gcode
Definition: g29_auto.py:44
float Kd
Definition: temperature.h:57
static void report_state()
#define DEBUG_EOL()
Definition: debug_out.h:86
static constexpr uint8_t correction
Definition: backlash.h:41
#define DEBUG_ECHOLNPGM(...)
Definition: debug_out.h:79
static FORCE_INLINE void first_load()
Definition: configuration_store.h:81
#define DEBUG_ERROR_START()
Definition: debug_out.h:73
#define DEFAULT_TRAVEL_ACCELERATION
Definition: Configuration_A3ides_2209_MINI.h:709
uint16_t servo_angles[EEPROM_NUM_SERVOS][2]
Definition: configuration_store.cpp:211
Stepper stepper
Definition: stepper.cpp:82
float retract_acceleration
Definition: planner.h:183
float Kp
Definition: temperature.h:56
int16_t lpq_len
Definition: configuration_store.cpp:247
static bool leveling_active
Definition: planner.h:276
uint32_t E5
Definition: configuration_store.cpp:120
#define SERIAL_ECHOPAIR(V...)
Definition: serial.h:114
static bool access_finish()
planner_settings_t planner_settings
Definition: configuration_store.cpp:147
bool Y
Definition: configuration_store.cpp:122
static FRESULT validate(_FDID *obj, FATFS **fs)
Definition: ff.c:3215
Definition: L6470_Marlin.h:30
#define HAS_CLASSIC_E_JERK
Definition: Conditionals_post.h:47
uint32_t motor_current_setting[3]
Definition: configuration_store.cpp:299
uint8_t grid_max_y
Definition: configuration_store.cpp:194
Definition: planner.h:178
static void calculate_volumetric_multipliers()
float runout_distance_mm
Definition: configuration_store.cpp:162
static bool access_start()
bool E3
Definition: configuration_store.cpp:122
tmc_sgt_t tmc_sgt
Definition: configuration_store.cpp:288
uint8_t i
Definition: screen_test_graph.c:72
#define SERIAL_ECHOLNPAIR_F(V...)
Definition: serial.h:177
static int8_t storage_slot
Definition: ubl.h:106
#define LOOP_XYZE_N(VAR)
Definition: types.h:62
Definition: L6470_Marlin.h:30
#define unscalePID_d(d)
Definition: temperature.h:152
AxisEnum
Definition: types.h:36
Definition: temperature.h:57
uint32_t Y
Definition: configuration_store.cpp:120
#define PREHEAT_2_TEMP_HOTEND
Definition: Configuration_A3ides_2209_MINI.h:1383
#define DEBUG_ECHOLNPAIR(...)
Definition: debug_out.h:82
char version[4]
Definition: configuration_store.cpp:139
PrintJobRecovery recovery
uint16_t E5
Definition: configuration_store.cpp:119
int16_t lcd_contrast
Definition: configuration_store.cpp:264
#define DEBUG_ECHO_START()
Definition: debug_out.h:72
uint16_t X
Definition: configuration_store.cpp:119
float feedRate_t
Definition: types.h:80
Definition: L6470_Marlin.h:30
#define update_workspace_offset(x)
Definition: motion.h:127
float Kp
Definition: temperature.h:57
xyz_pos_t coordinate_system[MAX_COORDINATE_SYSTEMS]
Definition: configuration_store.cpp:304
xyze_float_t planner_max_jerk
Definition: configuration_store.cpp:149
const float yz
Definition: planner.h:206
bool E5
Definition: configuration_store.cpp:122
uint8_t grid_max_x
Definition: configuration_store.cpp:194
#define scalePID_d(d)
Definition: temperature.h:151
abc_float_t delta_endstop_adj
static bool save()
Definition: configuration_store.cpp:2198
static bool sanity_check()
static void reset()
Definition: configuration_store.cpp:2208
#define XYZ
Definition: macros.h:27
static float z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]
Definition: mesh_bed_leveling.h:43
uint16_t Y2
Definition: configuration_store.cpp:119
bool X
Definition: configuration_store.cpp:122
static bool last_written_mode
Definition: bltouch.h:69
#define DEBUG_ECHOPGM(...)
Definition: debug_out.h:78
float planner_extruder_advance_K[EXTRUDERS]
Definition: configuration_store.cpp:294
int16_t Y
Definition: configuration_store.cpp:121
Definition: L6470_Marlin.h:30
Definition: vector_3.h:73
xyz_pos_t probe_offset
Definition: configuration_store.cpp:184
#define LINEAR_UNIT(V)
Definition: parser.h:299
PIDC_t hotendPID[HOTENDS]
Definition: configuration_store.cpp:246
bool runout_sensor_enabled
Definition: configuration_store.cpp:161
static const xyz_float_t distance_mm
Definition: backlash.h:42
Definition: configuration_store.cpp:120
#define E_AXIS_N(E)
Definition: Conditionals_LCD.h:454
float y2_endstop_adj
Definition: configuration_store.cpp:230
static void refresh_positioning()
Definition: planner.cpp:2806
#define FORCE_INLINE
Definition: macros.h:40
#define DEBUG_ERROR_MSG(...)
Definition: debug_out.h:85
#define SERIAL_ECHO_MSG(S)
Definition: serial.h:183
T b
Definition: types.h:287
#define PSTR(str)
Definition: pgmspace.h:31
void set_bed_leveling_enabled(const bool enable=true)
uint8_t mesh_num_x
Definition: configuration_store.cpp:173
bool Z
Definition: configuration_store.cpp:122
#define DEFAULT_MINTRAVELFEEDRATE
Definition: Configuration_A3ides_2209_MINI_adv.h:515
xyze_pos_t current_position
Definition: motion.cpp:102
Definition: L6470_Marlin.h:30
void recalc_delta_settings()
uint32_t X
Definition: configuration_store.cpp:120
static void digipot_current(const uint8_t driver, const int16_t current)
Definition: stepper.cpp:2495
bool autoretract_enabled
Definition: configuration_store.cpp:275
void onConfigurationStoreWritten(bool success)
Definition: marlin_server.cpp:937
#define EEPROM_VERSION
Definition: configuration_store.cpp:40
MarlinSettings settings
Definition: configuration_store.cpp:344
Definition: L6470_Marlin.h:30
Definition: L6470_Marlin.h:30
uint32_t Z3
Definition: configuration_store.cpp:120
fwretract_settings_t fwretract_settings
Definition: configuration_store.cpp:274
static FORCE_INLINE void report(const bool=false)
Definition: configuration_store.h:88
#define COUNT(a)
Definition: macros.h:200
float mbl_z_values[3][3]
Definition: configuration_store.cpp:177
Definition: configuration_store.cpp:119
#define PREHEAT_2_FAN_SPEED
Definition: Configuration_A3ides_2209_MINI.h:1385
#define LOOP_L_N(VAR, N)
Definition: types.h:58
#define unscalePID_i(i)
Definition: temperature.h:150
#define LOOP_XYZ(VAR)
Definition: types.h:60
uint8_t mesh_num_y
Definition: configuration_store.cpp:173
float travel_acceleration
Definition: planner.h:183
float axis_steps_per_mm[XYZE_N]
Definition: planner.h:181
xy_int_t bilinear_grid_spacing
#define DISABLED(V...)
Definition: macros.h:178
uint32_t Z
Definition: configuration_store.cpp:120
xy_int_t bilinear_start
Definition: configuration_store.cpp:195
void
Definition: png.h:1083
uint8_t ui_preheat_fan_speed[2]
Definition: configuration_store.cpp:241
void onStoreSettings(char *)
Definition: marlin_server.cpp:932
#define DEFAULT_MINIMUMFEEDRATE
Definition: Configuration_A3ides_2209_MINI_adv.h:514
void onLoadSettings(char const *)
Definition: marlin_server.cpp:927
static void reset()
Definition: runout.h:76
#define ALIM(I, ARR)
Definition: configuration_store.cpp:125
uint32_t E4
Definition: configuration_store.cpp:120
int16_t Z
Definition: configuration_store.cpp:121
float acceleration
Definition: planner.h:183
bool Z3
Definition: configuration_store.cpp:122
bool E0
Definition: configuration_store.cpp:122
#define PREHEAT_1_FAN_SPEED
Definition: Configuration_A3ides_2209_MINI.h:1380
uint32_t max_acceleration_mm_per_s2[XYZE_N]
Definition: planner.h:179
#define pgm_read_float(addr)
Definition: pgmspace.h:109
#define SERIAL_ECHOPGM(S)
Definition: serial.h:173
static void reset_acceleration_rates()
Definition: planner.cpp:2788
Definition: printcounter.h:38
uint32_t E1
Definition: configuration_store.cpp:120
void reset_stepper_drivers()
Definition: indirection.cpp:41
#define DEFAULT_ACCELERATION
Definition: Configuration_A3ides_2209_MINI.h:707
void onFactoryReset()
Definition: marlin_server.cpp:922
#define SERIAL_ECHOLNPAIR(V...)
Definition: serial.h:144
float mbl_z_offset
Definition: configuration_store.cpp:172
uint32_t Z2
Definition: configuration_store.cpp:120
list a
Definition: createSpeedLookupTable.py:29
#define HOTEND_LOOP()
Definition: Conditionals_LCD.h:436
#define scalePID_i(i)
Definition: temperature.h:149
#define DEFAULT_MINSEGMENTTIME
Definition: Configuration_A3ides_2209_MINI_adv.h:532
int16_t ui_preheat_bed_temp[2]
Definition: configuration_store.cpp:239
float Kc
Definition: temperature.h:57
matrix_3x3 planner_bed_level_matrix
Definition: configuration_store.cpp:189
#define HAS_CLASSIC_JERK
Definition: Conditionals_post.h:46
static float z2_endstop_adj
Definition: endstops.h:51
const uint8_t[]
Definition: 404_html.c:3
#define DEFAULT_MAX_FEEDRATE
Definition: Configuration_A3ides_2209_MINI.h:687
xyz_pos_t home_offset
Definition: configuration_store.cpp:152
#define AXIS_IS_TMC(A)
Definition: drivers.h:91
float planner_filament_size[EXTRUDERS]
Definition: configuration_store.cpp:281
static float z_offset
Definition: mesh_bed_leveling.h:43
int16_t X2
Definition: configuration_store.cpp:121
#define PREHEAT_2_TEMP_BED
Definition: Configuration_A3ides_2209_MINI.h:1384
const float xz
Definition: planner.h:206
uint8_t backlash_correction
Definition: configuration_store.cpp:329
abc_float_t delta_tower_angle_trim
uint32_t Y2
Definition: configuration_store.cpp:120
void update_software_endstops(const AxisEnum axis)
Definition: motion.cpp:503
bool Y2
Definition: configuration_store.cpp:122
Definition: L6470_Marlin.h:30
#define E_STEPPERS
Definition: Conditionals_LCD.h:429
PID_t bedPID
Definition: configuration_store.cpp:252
Definition: fwretract.h:30
#define DEBUG_ECHO(...)
Definition: debug_out.h:75
T y
Definition: types.h:286
#define DEFAULT_NOMINAL_FILAMENT_DIA
Definition: Configuration_A3ides_2209_MINI.h:151
#define MMS_TO_MMM(MM_S)
Definition: types.h:84
#define DEFAULT_AXIS_STEPS_PER_UNIT
Definition: Configuration_A3ides_2209_MINI.h:677
static bool read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing=true)
uint16_t E2
Definition: configuration_store.cpp:119
constexpr xyz_pos_t hotend_offset[1]
Definition: motion.h:136
uint32_t X2
Definition: configuration_store.cpp:120
#define NOZZLE_TO_PROBE_OFFSET
Definition: Configuration_A3ides_2209_MINI.h:858
uint8_t esteppers
Definition: configuration_store.cpp:145
#define MAX_COORDINATE_SYSTEMS
Definition: gcode.h:322
uint16_t E4
Definition: configuration_store.cpp:119
uint16_t Y
Definition: configuration_store.cpp:119
#define EXTRUDERS
Definition: Configuration_A3ides_2209_MINI.h:148
uint32_t E3
Definition: configuration_store.cpp:120
void report_current_position()
Definition: motion.cpp:199
static status_t status
Definition: filament_sensor.c:37
#define SERIAL_ECHOPAIR_F(S, V...)
Definition: serial.h:176
#define pgm_read_dword(addr)
Definition: pgmspace.h:105
bool bltouch_last_written_mode
Definition: configuration_store.cpp:216
Definition: L6470_Marlin.h:30
static void enable_globally(const bool onoff=true)
Definition: endstops.cpp:285
#define SERIAL_EOL()
Definition: serial.h:181
const float xy
Definition: planner.h:205
uint16_t Z3
Definition: configuration_store.cpp:119
void onConfigurationStoreRead(bool success)
Definition: marlin_server.cpp:941
static bool enabled
Definition: runout.h:53
static FORCE_INLINE bool load()
Definition: configuration_store.h:79
PersistentStore persistentStore
Definition: persistent_store_api.cpp:28
int8_t ubl_storage_slot
Definition: configuration_store.cpp:206
#define HOTENDS
Definition: Conditionals_LCD.h:425
uint32_t E0
Definition: configuration_store.cpp:120
uint16_t E0
Definition: configuration_store.cpp:119
#define VOLUMETRIC_UNIT(V)
Definition: parser.h:300
#define PID_PARAM(F, H)
Definition: temperature.h:87
int16_t X
Definition: configuration_store.cpp:121
float planner_junction_deviation_mm
Definition: configuration_store.cpp:150
void serialprintPGM(PGM_P str)
Definition: serial.cpp:35
#define TEMP_UNIT(N)
Definition: parser.h:363
float delta_calibration_radius
#define IS_CARTESIAN
Definition: Conditionals_LCD.h:546
static planner_settings_t settings
Definition: planner.h:251
tmc_hybrid_threshold_t tmc_hybrid_threshold
Definition: configuration_store.cpp:287
#define SERIAL_ECHOLNPGM(S)
Definition: serial.h:174
Definition: L6470_Marlin.h:30
float z3_endstop_adj
Definition: configuration_store.cpp:230
uint16_t X2
Definition: configuration_store.cpp:119
T c
Definition: types.h:287
Definition: configuration_store.cpp:121
float x2_endstop_adj
Definition: configuration_store.cpp:230
bool recovery_enabled
Definition: configuration_store.cpp:269
float z_values[3][3]
Definition: configuration_store.cpp:199
Definition: configuration_store.h:30
feedRate_t min_travel_feedrate_mm_s
Definition: planner.h:186
uint16_t Z2
Definition: configuration_store.cpp:119
Definition: L6470_Marlin.h:30
bool E1
Definition: configuration_store.cpp:122
Definition: temperature.h:56
#define EEPROM_NUM_SERVOS
Definition: configuration_store.cpp:80
static FORCE_INLINE bool init_eeprom()
Definition: configuration_store.h:37
Temperature thermalManager
Definition: temperature.cpp:89
#define UNUSED(X)
Definition: stm32f4xx_hal_def.h:74
Endstops endstops
Definition: endstops.cpp:51
#define STATS_EEPROM_ADDRESS
Definition: printcounter.h:33
static uint16_t datasize()
Definition: configuration_store.cpp:346
static bool enabled
Definition: power_loss_recovery.h:138
xyz_float_t backlash_distance_mm
Definition: configuration_store.cpp:328
#define DEFAULT_RETRACT_ACCELERATION
Definition: Configuration_A3ides_2209_MINI.h:708
uint16_t Z
Definition: configuration_store.cpp:119
uint32_t min_segment_time_us
Definition: planner.h:179
static bed_mesh_t z_values
Definition: ubl.h:108
float planner_z_fade_height
Definition: configuration_store.cpp:167
#define ENABLED(V...)
Definition: macros.h:177
uint16_t E3
Definition: configuration_store.cpp:119
#define PREHEAT_1_TEMP_HOTEND
Definition: Configuration_A3ides_2209_MINI.h:1378
Planner planner
Definition: planner.cpp:111
static png_bytep size_t size
Definition: pngwrite.c:2170
parser
Definition: createSpeedLookupTable.py:14
static void enable(const bool onoff)
static skew_factor_t skew_factor
Definition: planner.h:299