Prusa MINI Firmware overview
screen_menu_calibration.c File Reference
#include "gui.h"
#include "screen_menu.h"
#include "marlin_client.h"
#include "wizard/wizard.h"
#include "window_dlg_wait.h"
#include "menu_vars.h"

Enumerations

enum  MI_t {
  MI_RETURN, MI_RETURN, MI_WIZARD, MI_Z_OFFSET,
  MI_AUTO_HOME, MI_MESH_BED, MI_SELFTEST, MI_CALIB_FIRST,
  MI_RETURN, MI_LOAD, MI_UNLOAD, MI_CHANGE,
  MI_PURGE, MI_RETURN, MI_ALWAYS, MI_ON_RESTART,
  MI_COUNT, MI_RETURN, MI_SYS_INFO, MI_VERSIONS,
  MI_RETURN, MI_MOVE_X, MI_MOVE_Y, MI_MOVE_Z,
  MI_MOVE_E, MI_RETURN, MI_SYS_RESET, MI_CLR_EEPROM,
  MI_WDG_TEST, MI_PLL, MI_SSCG, MI_SSCG_FREQ,
  MI_SSCG_DEPTH, MI_SPI_PRESC, MI_MESH, MI_BSOD,
  MI_BSOD_HARD_FAULT, MI_COUNT, MI_RETURN, MI_TEMPERATURE,
  MI_MOVE_AXIS, MI_DISABLE_STEP, MI_FACTORY_DEFAULTS, MI_FW_UPDATE,
  MI_FILAMENT_SENSOR, MI_TIMEOUT, MI_LAN_SETTINGS, MI_RETURN,
  MI_NOZZLE, MI_HEATBED, MI_PRINTFAN, MI_COOLDOWN,
  MI_RETURN, MI_NOZZLE, MI_HEAT_PWM_PERIOD, MI_HEATBED,
  MI_FAN_PWM_PERIOD, MI_PRINTFAN, MI_COOLDOWN, MI_COUNT
}
 

Functions

void screen_menu_calibration_init (screen_t *screen)
 
int screen_menu_calibration_event (screen_t *screen, window_t *window, uint8_t event, void *param)
 

Variables

const menu_item_t _menu_calibration_items []
 
screen_t screen_menu_calibration
 
const screen_tpscreen_menu_calibration = &screen_menu_calibration
 

Enumeration Type Documentation

◆ MI_t

enum MI_t
Enumerator
MI_RETURN 
MI_RETURN 
MI_WIZARD 
MI_Z_OFFSET 
MI_AUTO_HOME 
MI_MESH_BED 
MI_SELFTEST 
MI_CALIB_FIRST 
MI_RETURN 
MI_LOAD 
MI_UNLOAD 
MI_CHANGE 
MI_PURGE 
MI_RETURN 
MI_ALWAYS 
MI_ON_RESTART 
MI_COUNT 
MI_RETURN 
MI_SYS_INFO 
MI_VERSIONS 
MI_RETURN 
MI_MOVE_X 
MI_MOVE_Y 
MI_MOVE_Z 
MI_MOVE_E 
MI_RETURN 
MI_SYS_RESET 
MI_CLR_EEPROM 
MI_WDG_TEST 
MI_PLL 
MI_SSCG 
MI_SSCG_FREQ 
MI_SSCG_DEPTH 
MI_SPI_PRESC 
MI_MESH 
MI_BSOD 
MI_BSOD_HARD_FAULT 
MI_COUNT 
MI_RETURN 
MI_TEMPERATURE 
MI_MOVE_AXIS 
MI_DISABLE_STEP 
MI_FACTORY_DEFAULTS 
MI_FW_UPDATE 
MI_FILAMENT_SENSOR 
MI_TIMEOUT 
MI_LAN_SETTINGS 
MI_RETURN 
MI_NOZZLE 
MI_HEATBED 
MI_PRINTFAN 
MI_COOLDOWN 
MI_RETURN 
MI_NOZZLE 
MI_HEAT_PWM_PERIOD 
MI_HEATBED 
MI_FAN_PWM_PERIOD 
MI_PRINTFAN 
MI_COOLDOWN 
MI_COUNT 
11  {
12  MI_RETURN,
13  MI_WIZARD,
18 // MI_CALIB_XYZ,
19 #ifdef WIZARD_Z_CALIBRATION
20 // MI_CALIB_Z,
21 #endif
22  // MI_CALIB_XY,
24 } MI_t;

Function Documentation

◆ screen_menu_calibration_init()

void screen_menu_calibration_init ( screen_t screen)
40  {
41  marlin_vars_t *vars;
42  int count = sizeof(_menu_calibration_items) / sizeof(menu_item_t);
43  screen_menu_init(screen, "CALIBRATION", count + 1, 0, 0);
45  memcpy(psmd->items + 1, _menu_calibration_items, count * sizeof(menu_item_t));
46 
48  psmd->items[MI_Z_OFFSET].item.wi_spin_fl.value = vars->z_offset;
49  psmd->items[MI_Z_OFFSET].item.wi_spin_fl.prt_format = zoffset_fl_format;
50  psmd->items[MI_Z_OFFSET].item.wi_spin_fl.range = zoffset_fl_range;
51 }
Here is the call graph for this function:

◆ screen_menu_calibration_event()

int screen_menu_calibration_event ( screen_t screen,
window_t window,
uint8_t  event,
void param 
)
53  {
54  if (screen_menu_event(screen, window, event, param))
55  return 1;
56  if ((event == WINDOW_EVENT_CHANGING) && ((int)param == MI_Z_OFFSET))
57  marlin_set_z_offset(psmd->items[MI_Z_OFFSET].item.wi_spin_fl.value);
58  else if ((event == WINDOW_EVENT_CHANGE) && ((int)param == MI_Z_OFFSET))
59  marlin_gcode("M500"); // store config when lose capture
60  else if (event == WINDOW_EVENT_CLICK) {
61  switch ((int)param) {
62  case MI_WIZARD:
64  break;
65  case MI_AUTO_HOME:
66  marlin_gcode("G28");
68  break;
69  case MI_MESH_BED:
70  marlin_gcode("G28");
71  marlin_gcode("G29");
73  break;
74  case MI_SELFTEST:
76  break;
77  /* case MI_CALIB_XYZ: wizard_run_xyzcalib(); break;
78 #ifdef WIZARD_Z_CALIBRATION
79  case MI_CALIB_Z: wizard_run_xyzcalib_z(); break;
80 #endif
81  case MI_CALIB_XY: wizard_run_xyzcalib_xy(); break;*/
82  case MI_CALIB_FIRST:
84  break;
85  }
86  }
87  return 0;
88 }
Here is the call graph for this function:

Variable Documentation

◆ _menu_calibration_items

const menu_item_t _menu_calibration_items[]
Initial value:
= {
{ { "Wizard", 0, WI_LABEL }, SCREEN_MENU_NO_SCREEN },
{ { "Z-offset", 0, WI_SPIN_FL }, SCREEN_MENU_NO_SCREEN },
{ { "Auto Home", 0, WI_LABEL }, SCREEN_MENU_NO_SCREEN },
{ { "Mesh Bed Level.", 0, WI_LABEL }, SCREEN_MENU_NO_SCREEN },
{ { "SelfTest", 0, WI_LABEL }, SCREEN_MENU_NO_SCREEN },
{ { "First Layer Cal.", 0, WI_LABEL }, SCREEN_MENU_NO_SCREEN },
}

◆ screen_menu_calibration

◆ pscreen_menu_calibration

const screen_t* pscreen_menu_calibration = &screen_menu_calibration
MI_Z_OFFSET
Definition: screen_menu_calibration.c:14
MI_WIZARD
Definition: screen_menu_calibration.c:13
_menu_item_t
Definition: screen_menu.h:19
screen_menu_draw
void screen_menu_draw(screen_t *screen)
Definition: screen_menu.c:90
MI_RETURN
Definition: screen_menu_calibration.c:12
MI_SELFTEST
Definition: screen_menu_calibration.c:17
wizard_run_complete
void wizard_run_complete(void)
Definition: wizard.c:54
screen_menu_event
int screen_menu_event(screen_t *screen, window_t *window, uint8_t event, void *param)
Definition: screen_menu.c:92
_marlin_vars_t::z_offset
float z_offset
Definition: marlin_vars.h:87
screen_menu_done
void screen_menu_done(screen_t *screen)
Definition: screen_menu.c:78
screen_menu_calibration_init
void screen_menu_calibration_init(screen_t *screen)
Definition: screen_menu_calibration.c:40
SCREEN_MENU_NO_SCREEN
#define SCREEN_MENU_NO_SCREEN
Definition: screen_menu.h:39
_menu_calibration_items
const menu_item_t _menu_calibration_items[]
Definition: screen_menu_calibration.c:26
WINDOW_EVENT_CHANGE
#define WINDOW_EVENT_CHANGE
Definition: window.h:47
gui_marlin_busy_callback
int8_t gui_marlin_busy_callback()
Definition: window_dlg_wait.c:216
MI_AUTO_HOME
Definition: screen_menu_calibration.c:15
gui_dlg_wait
int gui_dlg_wait(int8_t(*callback)())
Definition: window_dlg_wait.c:139
screen_menu_init
void screen_menu_init(screen_t *screen, const char *label, int count, uint8_t footer, uint8_t help)
Definition: screen_menu.c:25
wizard_run_firstlay
void wizard_run_firstlay(void)
Definition: wizard.c:84
psmd
#define psmd
Definition: screen_menu.h:40
WI_SPIN_FL
Definition: window_menu.h:18
marlin_gcode
void marlin_gcode(const char *gcode)
Definition: marlin_client.c:195
WINDOW_EVENT_CHANGING
#define WINDOW_EVENT_CHANGING
Definition: window.h:48
marlin_update_vars
marlin_vars_t * marlin_update_vars(uint64_t msk)
Definition: marlin_client.c:368
WI_LABEL
Definition: window_menu.h:14
screen_menu_calibration_event
int screen_menu_calibration_event(screen_t *screen, window_t *window, uint8_t event, void *param)
Definition: screen_menu_calibration.c:53
MI_CALIB_FIRST
Definition: screen_menu_calibration.c:23
MARLIN_VAR_MSK
#define MARLIN_VAR_MSK(v_id)
Definition: marlin_vars.h:35
menu_item_return
const menu_item_t menu_item_return
Definition: screen_menu.c:14
WINDOW_EVENT_CLICK
#define WINDOW_EVENT_CLICK
Definition: window.h:46
zoffset_fl_format
const char * zoffset_fl_format
Definition: menu_vars.cpp:30
zoffset_fl_range
const float zoffset_fl_range[3]
Definition: menu_vars.cpp:29
screen_menu_data_t
Definition: screen_menu.h:24
_marlin_vars_t
Definition: marlin_vars.h:77
marlin_set_z_offset
float marlin_set_z_offset(float val)
Definition: marlin_client.c:409
wizard_run_selftest
void wizard_run_selftest(void)
Definition: wizard.c:58
MI_t
MI_t
Definition: screen_menu_calibration.c:11
MI_MESH_BED
Definition: screen_menu_calibration.c:16
MARLIN_VAR_Z_OFFSET
#define MARLIN_VAR_Z_OFFSET
Definition: marlin_vars.h:23