Prusa MINI Firmware overview
window_dlg_loadunload_shared.h
Go to the documentation of this file.
1 // window_dlg_loadunload_shared.h
2 
3 #ifndef _WINDOW_DLG_LOADUNLOAD_SHARED_H
4 #define _WINDOW_DLG_LOADUNLOAD_SHARED_H
5 
7 #include "marlin_client.h" //marlin_vars_t
8 
9 #pragma pack(push)
10 #pragma pack(1)
11 
12 //load unload dialog specific vars
13 typedef struct
14 {
16  float z_min_extr_pos; //minimal z position for extruding
17  float initial_move;
18  float z_start;
19  float e_start;
20  float e_last; //todo use me more
21 } _dlg_ld_vars;
22 
23 #pragma pack(pop)
24 
25 /*****************************************************************************/
26 //shared for LOAD and UNLOAD
27 
28 #define LD_BT_DONE DLG_DI_US0 //continue button for marlin
29 #define LD_BT_PURG DLG_DI_US1 //resume button for marlin
30 #define LD_BT_PURG_SEL DLG_DI_US2 //when flag is 0 active button is done
31 //when flag is 1 active button is purge
32 
33 extern const float ld_purge_amount;
34 
35 extern const _dlg_button_t bt_stop_ena;
36 extern const _dlg_button_t bt_stop_dis;
37 extern const _dlg_button_t bt_cont_ena;
38 extern const _dlg_button_t bt_cont_dis;
39 extern const _dlg_button_t bt_none;
40 
41 extern void f_SH_on_load(void); //after start
42 extern loop_result_t f_SH_on_loop(_dlg_vars *p_vars, _dlg_ld_vars *p_additional_vars); //begin of each cycle
43 extern void f_SH_on_timeout(); //on_timeout
44 
45 extern int f_SH_INIT(_dlg_vars *p_vars, _dlg_ld_vars *additional_vars);
46 extern int f_SH_MOVE_INITIAL_Z(_dlg_vars *p_vars, _dlg_ld_vars *additional_vars);
47 extern int f_SH_WAIT_INITIAL_Z_MOTION(_dlg_vars *p_vars, _dlg_ld_vars *additional_vars);
48 extern int f_SH_WAIT_INITIAL_Z_STOPPED(_dlg_vars *p_vars, _dlg_ld_vars *additional_vars);
49 extern int f_SH_WAIT_E_MOTION(_dlg_vars *p_vars, _dlg_ld_vars *additional_vars);
50 extern int f_SH_WAIT_E_STOPPED(_dlg_vars *p_vars, _dlg_ld_vars *additional_vars);
51 extern int f_SH_WAIT_TEMP(_dlg_vars *p_vars, _dlg_ld_vars *additional_vars);
52 
53 //Externs from load
55  int is_donelhs_purgerhs);
56 
57 void window_dlg_load_event_cb(window_dlg_statemachine_t *window, uint8_t event, void *param);
58 
60 
61 #endif //_WINDOW_DLG_LOADUNLOAD_SHARED_H
f_SH_WAIT_INITIAL_Z_MOTION
int f_SH_WAIT_INITIAL_Z_MOTION(_dlg_vars *p_vars, _dlg_ld_vars *additional_vars)
Definition: window_dlg_loadunload_shared.c:85
window_dlg_loadunload_shared.h
bt_stop_ena
const _dlg_button_t bt_stop_ena
Definition: window_dlg_loadunload_shared.c:20
BT_ENABLED
#define BT_ENABLED
Definition: window_dlg_statemachine.h:15
f_SH_on_loop
loop_result_t f_SH_on_loop(_dlg_vars *p_vars, _dlg_ld_vars *additional_vars)
Definition: window_dlg_loadunload_shared.c:47
f_SH_WAIT_E_MOTION
int f_SH_WAIT_E_MOTION(_dlg_vars *p_vars, _dlg_ld_vars *additional_vars)
Definition: window_dlg_loadunload_shared.c:112
f_SH_WAIT_INITIAL_Z_STOPPED
int f_SH_WAIT_INITIAL_Z_STOPPED(_dlg_vars *p_vars, _dlg_ld_vars *additional_vars)
Definition: window_dlg_loadunload_shared.c:98
z_offset_step
const float z_offset_step
Definition: menu_vars.cpp:26
window_dlg_load_event_cb
void window_dlg_load_event_cb(window_dlg_statemachine_t *window, uint8_t event, void *param)
Definition: window_dlg_load.c:56
_dlg_vars::flags
uint8_t flags
Definition: window_dlg_statemachine.h:38
window_dlg_load_draw_buttons
void window_dlg_load_draw_buttons(window_dlg_statemachine_t *window, int is_donelhs_purgerhs)
Definition: window_dlg_load.c:22
bt_none
const _dlg_button_t bt_none
Definition: window_dlg_loadunload_shared.c:38
marlin_client.h
f_SH_WAIT_E_MOTION
int f_SH_WAIT_E_MOTION(_dlg_vars *p_vars, _dlg_ld_vars *additional_vars)
Definition: window_dlg_loadunload_shared.c:112
f_SH_on_timeout
void f_SH_on_timeout()
Definition: window_dlg_loadunload_shared.c:59
BT_AUTOEXIT
#define BT_AUTOEXIT
Definition: window_dlg_statemachine.h:17
txt_none
static const char * txt_none[]
Definition: window_dlg_loadunload_shared.c:18
f_SH_WAIT_TEMP
int f_SH_WAIT_TEMP(_dlg_vars *p_vars, _dlg_ld_vars *additional_vars)
Definition: window_dlg_loadunload_shared.c:126
MARLIN_VAR_MOTION
#define MARLIN_VAR_MOTION
Definition: marlin_vars.h:8
ld_purge_amount
const float ld_purge_amount
Definition: window_dlg_loadunload_shared.c:14
f_SH_INIT
int f_SH_INIT(_dlg_vars *p_vars, _dlg_ld_vars *additional_vars)
Definition: window_dlg_loadunload_shared.c:67
window_dlg_statemachine_event_1bt
void window_dlg_statemachine_event_1bt(window_dlg_statemachine_t *window, uint8_t event, void *param)
Definition: window_dlg_statemachine.c:235
f_SH_WAIT_TEMP
int f_SH_WAIT_TEMP(_dlg_vars *p_vars, _dlg_ld_vars *additional_vars)
Definition: window_dlg_loadunload_shared.c:126
_dlg_ld_vars::z_start
float z_start
Definition: window_dlg_loadunload_shared.h:18
_dlg_ld_vars::e_last
float e_last
Definition: window_dlg_loadunload_shared.h:20
window_dlg_load_event_inverted_cb
void window_dlg_load_event_inverted_cb(window_dlg_statemachine_t *window, uint8_t event, void *param)
Definition: window_dlg_load.c:83
_dlg_vars::phase
int8_t phase
Definition: window_dlg_statemachine.h:39
txt_cont
static const char * txt_cont[]
Definition: window_dlg_loadunload_shared.c:17
dbg.h
NULL
#define NULL
Definition: usbd_def.h:53
F
#define F(str)
Definition: UHS_macros.h:164
_dlg_ld_vars::e_start
float e_start
Definition: window_dlg_loadunload_shared.h:19
f_SH_MOVE_INITIAL_Z
int f_SH_MOVE_INITIAL_Z(_dlg_vars *p_vars, _dlg_ld_vars *additional_vars)
Definition: window_dlg_loadunload_shared.c:74
_window_dlg_statemachine_t
Definition: window_dlg_statemachine.h:87
HAL_GetTick
uint32_t HAL_GetTick(void)
Provides a tick value in millisecond.
Definition: stm32f4xx_hal.c:339
_marlin_vars_t::temp_nozzle
float temp_nozzle
Definition: marlin_vars.h:83
_dlg_ld_vars::z_min_extr_pos
float z_min_extr_pos
Definition: window_dlg_loadunload_shared.h:16
f_SH_WAIT_E_STOPPED
int f_SH_WAIT_E_STOPPED(_dlg_vars *p_vars, _dlg_ld_vars *additional_vars)
Definition: window_dlg_loadunload_shared.c:119
LOOP_RESULT_BREAK
Definition: window_dlg_statemachine.h:52
_was_move
int _was_move(_dlg_ld_vars *additional_vars)
Definition: window_dlg_loadunload_shared.c:63
bt_none
const _dlg_button_t bt_none
Definition: window_dlg_loadunload_shared.c:38
ld_purge_amount
const float ld_purge_amount
Definition: window_dlg_loadunload_shared.c:14
MARLIN_VAR_TEMP_NOZ
#define MARLIN_VAR_TEMP_NOZ
Definition: marlin_vars.h:19
f_SH_WAIT_E_STOPPED
int f_SH_WAIT_E_STOPPED(_dlg_vars *p_vars, _dlg_ld_vars *additional_vars)
Definition: window_dlg_loadunload_shared.c:119
MARLIN_EVT_CommandEnd
#define MARLIN_EVT_CommandEnd
Definition: marlin_events.h:34
LOOP_RESULT_CONTINUE
Definition: window_dlg_statemachine.h:51
menu_vars.h
_marlin_vars_t::target_nozzle
float target_nozzle
Definition: marlin_vars.h:85
bt_stop_dis
const _dlg_button_t bt_stop_dis
Definition: window_dlg_loadunload_shared.c:25
display_helper.h
_dlg_ld_vars
Definition: window_dlg_loadunload_shared.h:13
bt_stop_dis
const _dlg_button_t bt_stop_dis
Definition: window_dlg_loadunload_shared.c:25
marlin_gcode
void marlin_gcode(const char *gcode)
Definition: marlin_client.c:195
MARLIN_VAR_POS_Z
#define MARLIN_VAR_POS_Z
Definition: marlin_vars.h:17
MARLIN_VAR_POS_E
#define MARLIN_VAR_POS_E
Definition: marlin_vars.h:18
marlin_update_vars
marlin_vars_t * marlin_update_vars(uint64_t msk)
Definition: marlin_client.c:368
window_dlg_statemachine_draw_0bt
void window_dlg_statemachine_draw_0bt(window_dlg_statemachine_t *window)
Definition: window_dlg_statemachine.c:94
uint8_t
const uint8_t[]
Definition: 404_html.c:3
f_SH_WAIT_INITIAL_Z_STOPPED
int f_SH_WAIT_INITIAL_Z_STOPPED(_dlg_vars *p_vars, _dlg_ld_vars *additional_vars)
Definition: window_dlg_loadunload_shared.c:98
MARLIN_VAR_MSK
#define MARLIN_VAR_MSK(v_id)
Definition: marlin_vars.h:35
_dlg_vars
Definition: window_dlg_statemachine.h:36
bt_cont_ena
const _dlg_button_t bt_cont_ena
Definition: window_dlg_loadunload_shared.c:29
f_SH_on_loop
loop_result_t f_SH_on_loop(_dlg_vars *p_vars, _dlg_ld_vars *p_additional_vars)
Definition: window_dlg_loadunload_shared.c:47
f_SH_MOVE_INITIAL_Z
int f_SH_MOVE_INITIAL_Z(_dlg_vars *p_vars, _dlg_ld_vars *additional_vars)
Definition: window_dlg_loadunload_shared.c:74
f_SH_on_load
void f_SH_on_load(void)
Definition: window_dlg_loadunload_shared.c:42
f_SH_on_load
void f_SH_on_load(void)
Definition: window_dlg_loadunload_shared.c:42
bt_cont_dis
const _dlg_button_t bt_cont_dis
Definition: window_dlg_loadunload_shared.c:34
stm32f4xx_hal.h
This file contains all the functions prototypes for the HAL module driver.
DLG_CH_CMD
#define DLG_CH_CMD
Definition: window_dlg_statemachine.h:20
txt_stop
static const char * txt_stop[]
Definition: window_dlg_loadunload_shared.c:16
f_SH_INIT
int f_SH_INIT(_dlg_vars *p_vars, _dlg_ld_vars *additional_vars)
Definition: window_dlg_loadunload_shared.c:67
f_SH_WAIT_E_MOTION__WAIT_TEMP
int f_SH_WAIT_E_MOTION__WAIT_TEMP(_dlg_vars *p_vars, _dlg_ld_vars *additional_vars)
Definition: window_dlg_loadunload_shared.c:144
bt_stop_ena
const _dlg_button_t bt_stop_ena
Definition: window_dlg_loadunload_shared.c:20
_marlin_vars_t
Definition: marlin_vars.h:77
MARLIN_VAR_INDEX_Z
#define MARLIN_VAR_INDEX_Z
Definition: marlin_vars.h:66
_marlin_vars_t::pos
float pos[4]
Definition: marlin_vars.h:82
gui.h
MARLIN_VAR_TTEM_NOZ
#define MARLIN_VAR_TTEM_NOZ
Definition: marlin_vars.h:21
window_dlg_statemachine.h
MARLIN_VAR_MOTION_MSK_E
#define MARLIN_VAR_MOTION_MSK_E
Definition: marlin_vars.h:71
window_dlg_statemachine_draw_1bt
void window_dlg_statemachine_draw_1bt(window_dlg_statemachine_t *window)
Definition: window_dlg_statemachine.c:87
_dlg_vars::tick_part_start
uint32_t tick_part_start
Definition: window_dlg_statemachine.h:46
f_SH_WAIT_INITIAL_Z_MOTION
int f_SH_WAIT_INITIAL_Z_MOTION(_dlg_vars *p_vars, _dlg_ld_vars *additional_vars)
Definition: window_dlg_loadunload_shared.c:85
_dlg_ld_vars::p_marlin_vars
marlin_vars_t * p_marlin_vars
Definition: window_dlg_loadunload_shared.h:15
f_SH_on_timeout
void f_SH_on_timeout(void)
Definition: window_dlg_loadunload_shared.c:59
marlin_gcode_printf
int marlin_gcode_printf(const char *format,...)
Definition: marlin_client.c:206
loop_result_t
loop_result_t
Definition: window_dlg_statemachine.h:50
bt_cont_dis
const _dlg_button_t bt_cont_dis
Definition: window_dlg_loadunload_shared.c:34
_dlg_ld_vars::initial_move
float initial_move
Definition: window_dlg_loadunload_shared.h:17
_marlin_vars_t::motion
uint8_t motion
Definition: marlin_vars.h:78
_dlg_button_t
Definition: window_dlg_statemachine.h:59
marlin_event_clr
int marlin_event_clr(uint8_t evt_id)
Definition: marlin_client.c:252
MARLIN_VAR_MOTION_MSK_Z
#define MARLIN_VAR_MOTION_MSK_Z
Definition: marlin_vars.h:70
bt_cont_ena
const _dlg_button_t bt_cont_ena
Definition: window_dlg_loadunload_shared.c:29