Prusa MINI Firmware overview
firstlay.h
Go to the documentation of this file.
1 // firstlay.h
2 #ifndef _FIRSTLAY_H
3 #define _FIRSTLAY_H
4 
5 //choose 0 off 1 on
6 #define DEBUG_TERM 0
7 //#define DEBUG_TERM 1
8 
9 #include <inttypes.h>
10 #include "gui.h"
11 #include "wizard_types.h"
12 #include "wizard_load_unload.h"
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif //__cplusplus
17 
18 #pragma pack(push)
19 #pragma pack(1)
20 
21 typedef enum {
26 } _FL_STATE;
27 
28 #define FIRSTLAY_SCREEN_TERM_X 25
29 #define FIRSTLAY_SCREEN_TERM_Y 10
30 typedef struct
31 {
34 #if DEBUG_TERM == 0
36 #else
37  window_term_t term;
38  term_t terminal;
39  uint8_t term_buff[TERM_BUFF_SIZE(FIRSTLAY_SCREEN_TERM_X, FIRSTLAY_SCREEN_TERM_Y)]; //chars and attrs (640 bytes) + change bitmask (40 bytes)
40 #endif
41 
44 
48 
49  float Z_offset;
51 
52  //it is being deleted i do not know why. size isue?
53  /*const char** head_gcode;
54  const char** body_gcode;
55  size_t head_gcode_sz;
56  size_t body_gcode_sz;
57  size_t gcode_sz;*/
58 
59  uint32_t timer0;
61 
62 //#pragma pack(1) makes enums 8 bit
63 typedef struct
64 {
65  //_TEST_STATE_t state_heat;
68 
70 
71 #pragma pack(pop)
72 
73 extern void wizard_firstlay_event_dn(firstlay_screen_t *p_screen);
74 
75 extern void wizard_firstlay_event_up(firstlay_screen_t *p_screen);
76 
77 extern void wizard_init_screen_firstlay(int16_t id_body,
78  firstlay_screen_t *p_screen, firstlay_data_t *p_data);
79 /*
80 extern int wizard_firstlay_heat(int16_t id_body,
81  firstlay_screen_t* p_screen, firstlay_data_t* p_data);
82 
83 extern int wizard_firstlay_load(int16_t id_body,
84  firstlay_screen_t* p_screen, firstlay_data_t* p_data);
85 */
86 extern int wizard_firstlay_print(int16_t id_body,
87  firstlay_screen_t *p_screen, firstlay_data_t *p_data, float z_offset);
88 
89 #ifdef __cplusplus
90 }
91 #endif //__cplusplus
92 
93 #endif //_FIRSTLAY_H
firstlay_screen_t::state
_FL_STATE state
Definition: firstlay.h:32
_window_text_t
Definition: window_text.h:15
firstlay_screen_t::text_Z_pos
window_text_t text_Z_pos
Definition: firstlay.h:45
line_head
static uint32_t line_head
Definition: firstlay.c:35
_FL_GCODE_DONE
Definition: firstlay.h:25
V2_gcodes_head_PETG_sz
const size_t V2_gcodes_head_PETG_sz
Definition: firstlay.c:25
firstlay_screen_t::spin_baby_step
window_numb_t spin_baby_step
Definition: firstlay.h:47
max_gcodes_in_one_run
const size_t max_gcodes_in_one_run
Definition: firstlay.c:33
z_offset_step
const float z_offset_step
Definition: menu_vars.cpp:26
z_offset_min
const float z_offset_min
Definition: menu_vars.cpp:27
FIRSTLAY_SCREEN_TERM_Y
#define FIRSTLAY_SCREEN_TERM_Y
Definition: firstlay.h:29
marlin_client.h
wizard_firstlay_print
int wizard_firstlay_print(int16_t id_body, firstlay_screen_t *p_screen, firstlay_data_t *p_data, float z_offset)
Definition: firstlay.c:118
_set_gcode_first_lines
void _set_gcode_first_lines()
Definition: firstlay.c:444
WINDOW_CLS_TERM
#define WINDOW_CLS_TERM
Definition: window.h:17
firstlay_screen_t
Definition: firstlay.h:30
head_gcode_sz
static size_t head_gcode_sz
Definition: firstlay.c:40
WINDOW_CLS_NUMB
#define WINDOW_CLS_NUMB
Definition: window.h:11
_term_t
Definition: term.h:43
V2_gcodes_head_FLEX
const char * V2_gcodes_head_FLEX[]
Definition: firstlay.c:21
_TEST_FAILED
Definition: wizard_types.h:88
_FL_GCODE_BODY
Definition: firstlay.h:24
wizard_ui.h
V2_gcodes_head_ASA
const char * V2_gcodes_head_ASA[]
Definition: firstlay.c:20
window_destroy_children
void window_destroy_children(int16_t id)
Definition: window.c:157
_FL_INIT
Definition: firstlay.h:22
window_set_format
void window_set_format(int16_t id, const char *format)
Definition: window.c:403
_window_numb_t::color_text
color_t color_text
Definition: window_numb.h:20
window_invalidate
void window_invalidate(int16_t id)
Definition: window.c:304
rect_ui16
static rect_ui16_t rect_ui16(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
Definition: guitypes.h:159
_point_ui16_t::x
uint16_t x
Definition: guitypes.h:65
_window_term_t::term
term_t * term
Definition: window_term.h:20
WIZARD_MARGIN_LEFT
#define WIZARD_MARGIN_LEFT
Definition: wizard_ui.h:8
firstlay.h
wizard_load_unload.h
_FL_STATE
_FL_STATE
Definition: firstlay.h:21
IDR_FNT_NORMAL
#define IDR_FNT_NORMAL
Definition: resource.h:10
wizard_progress_bar.h
_TEST_STATE_t
_TEST_STATE_t
Definition: wizard_types.h:84
head_gcode
static const char ** head_gcode
Definition: firstlay.c:38
marlin_do_babysteps_Z
void marlin_do_babysteps_Z(float offs)
Definition: marlin_client.c:433
FILAMENT_PETG
Definition: filament.h:28
firstlay_data_t::state_print
_TEST_STATE_t state_print
Definition: firstlay.h:67
_wizard_firstlay_Z_step
void _wizard_firstlay_Z_step(firstlay_screen_t *p_screen)
Definition: firstlay.c:257
dbg.h
FIRSTLAY_SCREEN_TERM_X
#define FIRSTLAY_SCREEN_TERM_X
Definition: firstlay.h:28
z_offset_max
const float z_offset_max
Definition: menu_vars.cpp:28
NULL
#define NULL
Definition: usbd_def.h:53
commands_in_queue_use_max
const size_t commands_in_queue_use_max
Definition: firstlay.c:32
firstlay_screen_t::progress
window_progress_t progress
Definition: firstlay.h:33
window_show
void window_show(int16_t id)
Definition: window.c:529
_wizard_firstlay_text
static const char * _wizard_firstlay_text
Definition: firstlay.c:52
FILAMENT_PLA
Definition: filament.h:27
marlin_error_clr
int marlin_error_clr(uint8_t err_id)
Definition: marlin_client.c:324
wizard_firstlay_event_dn
void wizard_firstlay_event_dn(firstlay_screen_t *p_screen)
Definition: firstlay.c:241
_point_ui16_t
Definition: guitypes.h:64
_window_t::id
int16_t id
Definition: window.h:79
V2_gcodes_head_FLEX_sz
const size_t V2_gcodes_head_FLEX_sz
Definition: firstlay.c:27
firstlay_screen_t::load_unload_state
LD_UNLD_STATE_t load_unload_state
Definition: firstlay.h:43
COLOR_GRAY
#define COLOR_GRAY
Definition: guitypes.h:50
MARLIN_ERR_ProbingFailed
#define MARLIN_ERR_ProbingFailed
Definition: marlin_errors.h:9
body_gcode
static const char ** body_gcode
Definition: firstlay.c:39
guitypes.h
_window_numb_t
Definition: window_numb.h:17
WIZARD_X_SPACE
#define WIZARD_X_SPACE
Definition: wizard_ui.h:10
_window_term_t::win
window_t win
Definition: window_term.h:16
window_set_text
void window_set_text(int16_t id, const char *text)
Definition: window.c:340
marlin_get_gqueue
uint8_t marlin_get_gqueue(void)
Definition: marlin_client.c:381
COLOR_ORANGE
#define COLOR_ORANGE
Definition: guitypes.h:57
firstlay_screen_t::Z_offset_request
float Z_offset_request
Definition: firstlay.h:50
WINDOW_CLS_PROGRESS
#define WINDOW_CLS_PROGRESS
Definition: window.h:20
_point_ui16_t::y
uint16_t y
Definition: guitypes.h:66
firstlay_screen_t::extruder_start_len
float extruder_start_len
Definition: firstlay.h:42
LD_UNLD_STATE_t
LD_UNLD_STATE_t
Definition: wizard_load_unload.h:9
V2_gcodes_head_PETG
const char * V2_gcodes_head_PETG[]
Definition: firstlay.c:19
V__GCODES_HEAD_END
#define V__GCODES_HEAD_END
Definition: firstlay.c:288
MSGBOX_BTN_RETRYCANCEL
#define MSGBOX_BTN_RETRYCANCEL
Definition: window_msgbox.h:25
menu_vars.h
_TEST_RUN
Definition: wizard_types.h:86
gcode_sz
static size_t gcode_sz
Definition: firstlay.c:42
G28_pos
static size_t G28_pos
Definition: firstlay.c:43
wizard_firstlay_print
int wizard_firstlay_print(int16_t id_body, firstlay_screen_t *p_screen, firstlay_data_t *p_data, float z_offset)
Definition: firstlay.c:118
window_set_value
void window_set_value(int16_t id, float value)
Definition: window.c:363
get_filament
FILAMENT_t get_filament()
Definition: filament.cpp:41
V2_gcodes_body
const char * V2_gcodes_body[]
Definition: firstlay.c:22
firstlay_data_t
Definition: firstlay.h:63
body_gcode_sz
static size_t body_gcode_sz
Definition: firstlay.c:41
FILAMENT_FLEX
Definition: filament.h:30
G29_pos
static size_t G29_pos
Definition: firstlay.c:44
wizard_firstlay_event_dn
void wizard_firstlay_event_dn(firstlay_screen_t *p_screen)
Definition: firstlay.c:241
marlin_gcode
void marlin_gcode(const char *gcode)
Definition: marlin_client.c:195
filament.h
_run_gcode_line
int _run_gcode_line(uint32_t *p_line, const char *gcodes[], size_t gcodes_count)
Definition: firstlay.c:450
uint8_t
const uint8_t[]
Definition: 404_html.c:3
commands_in_queue_size
const size_t commands_in_queue_size
Definition: firstlay.c:31
wizard_init_screen_firstlay
void wizard_init_screen_firstlay(int16_t id_body, firstlay_screen_t *p_screen, firstlay_data_t *p_data)
Definition: firstlay.c:67
firstlay_screen_t::Z_offset
float Z_offset
Definition: firstlay.h:49
firstlay_data_t::state_load
_TEST_STATE_t state_load
Definition: firstlay.h:66
WINDOW_CLS_TEXT
#define WINDOW_CLS_TEXT
Definition: window.h:10
firstlay_screen_t::text_state
window_text_t text_state
Definition: firstlay.h:35
_TEST_START
Definition: wizard_types.h:85
wizard_firstlay_event_up
void wizard_firstlay_event_up(firstlay_screen_t *p_screen)
Definition: firstlay.c:249
resource_font
font_t * resource_font(uint16_t id)
Definition: guitypes.c:186
MSGBOX_RES_RETRY
#define MSGBOX_RES_RETRY
Definition: window_msgbox.h:42
term_init
void term_init(term_t *pt, uint8_t cols, uint8_t rows, uint8_t *buff)
Definition: term.c:6
firstlay_screen_t::text_direction_arrow
window_text_t text_direction_arrow
Definition: firstlay.h:46
V2_gcodes_body_sz
const size_t V2_gcodes_body_sz
Definition: firstlay.c:28
stm32f4xx_hal.h
This file contains all the functions prototypes for the HAL module driver.
window_create_ptr
int16_t window_create_ptr(int16_t cls_id, int16_t id_parent, rect_ui16_t rect, void *ptr)
Definition: window.c:102
wizard_types.h
IDR_FNT_SMALL
#define IDR_FNT_SMALL
Definition: resource.h:9
V__GCODES_HEAD_BEGIN
#define V__GCODES_HEAD_BEGIN
Definition: firstlay.c:283
firstlay_screen_t::timer0
uint32_t timer0
Definition: firstlay.h:59
_window_term_t
Definition: window_term.h:15
line_body
static uint32_t line_body
Definition: firstlay.c:36
V2_gcodes_head_PLA
const char * V2_gcodes_head_PLA[]
Definition: firstlay.c:18
config.h
_window_text_t::font
font_t * font
Definition: window_text.h:19
wizard_msgbox
int wizard_msgbox(const char *text, uint16_t flags, uint16_t id_icon)
Definition: wizard_ui.c:42
marlin_error
int marlin_error(uint8_t err_id)
Definition: marlin_client.c:304
V2_gcodes_head_PLA_sz
const size_t V2_gcodes_head_PLA_sz
Definition: firstlay.c:24
wizard_firstlay_event_up
void wizard_firstlay_event_up(firstlay_screen_t *p_screen)
Definition: firstlay.c:249
TERM_BUFF_SIZE
#define TERM_BUFF_SIZE(c, r)
Definition: term.h:36
gui.h
V2_gcodes_head_ASA_sz
const size_t V2_gcodes_head_ASA_sz
Definition: firstlay.c:26
_get_progress
int _get_progress()
Definition: firstlay.c:435
_FL_GCODE_HEAD
Definition: firstlay.h:23
font_meas_text
point_ui16_t font_meas_text(font_t *pf, const char *str)
Definition: guitypes.c:97
wizard_init_screen_firstlay
void wizard_init_screen_firstlay(int16_t id_body, firstlay_screen_t *p_screen, firstlay_data_t *p_data)
Definition: firstlay.c:67
_window_progress_t::win
window_t win
Definition: window_progress.h:16
_window_progress_t
Definition: window_progress.h:15
_window_numb_t::win
window_t win
Definition: window_numb.h:18
wizard_config.h
_window_text_t::win
window_t win
Definition: window_text.h:16
_TEST_PASSED
Definition: wizard_types.h:87
term_printf
int term_printf(term_t *pt, const char *fmt,...)
Definition: term.c:178
FILAMENT_ASA
Definition: filament.h:29