Prusa MINI Firmware overview
selftest_fans_axis.h
Go to the documentation of this file.
1 // selftest_fans_axis.h
2 #ifndef _SELFTEST_FANS_AXIS_H
3 #define _SELFTEST_FANS_AXIS_H
4 
5 #include <inttypes.h>
6 #include "gui.h"
7 #include "wizard_types.h"
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif //__cplusplus
12 
13 #pragma pack(push)
14 #pragma pack(1)
15 //todo create multiple small structures inside this structure
16 typedef struct
17 {
32  uint32_t timer0;
33  uint32_t timer1;
35 
36 //#pragma pack(1) makes enums 8 bit
37 typedef struct
38 {
44 
45  float axis_min[3];
46  float axis_max[3];
48 
49 #pragma pack(pop)
50 
51 extern void wizard_init_screen_selftest_fans_axis(int16_t id_body, selftest_fans_axis_screen_t *p_screen,
53 
54 extern int wizard_selftest_fan0(int16_t id_body, selftest_fans_axis_screen_t *p_screen, selftest_fans_axis_data_t *p_data);
55 
56 extern int wizard_selftest_fan1(int16_t id_body, selftest_fans_axis_screen_t *p_screen, selftest_fans_axis_data_t *p_data);
57 
58 extern int wizard_selftest_x(int16_t id_body, selftest_fans_axis_screen_t *p_screen, selftest_fans_axis_data_t *p_data);
59 
60 extern int wizard_selftest_y(int16_t id_body, selftest_fans_axis_screen_t *p_screen, selftest_fans_axis_data_t *p_data);
61 
62 extern int wizard_selftest_z(int16_t id_body, selftest_fans_axis_screen_t *p_screen, selftest_fans_axis_data_t *p_data);
63 
64 #ifdef __cplusplus
65 }
66 #endif //__cplusplus
67 
68 #endif //_SELFTEST_FANS_AXIS_H
selftest.h
_window_text_t
Definition: window_text.h:15
_SELFTEST_Z_TIME
#define _SELFTEST_Z_TIME
Definition: wizard_config.h:31
selftest_fans_axis_data_t::state_y
_TEST_STATE_t state_y
Definition: selftest_fans_axis.h:42
X_home_gcode
constexpr const char X_home_gcode[]
Definition: menu_vars.cpp:54
marlin_wait_motion
int marlin_wait_motion(uint32_t timeout)
Definition: marlin_client.c:187
Y_home_gcode
constexpr const char Y_home_gcode[]
Definition: menu_vars.cpp:71
selftest_fans_axis_data_t::state_z
_TEST_STATE_t state_z
Definition: selftest_fans_axis.h:43
ph_wait_motion
static int ph_wait_motion(selftest_fans_axis_data_t *p_data, uint8_t *state, int axis, int fr, int min, int max, int dir, char achar, float pos)
Definition: selftest_fans_axis.c:163
marlin_client.h
_SELFTEST_Z_MAX
#define _SELFTEST_Z_MAX
Definition: wizard_config.h:29
_get_pos
static float _get_pos(int axis)
Definition: selftest_fans_axis.c:120
selftest_fans_axis_screen_t::timer1
uint32_t timer1
Definition: selftest_fans_axis.h:33
_cl_st_ax::sz
const size_t sz
Definition: selftest_fans_axis.c:133
_SELFTEST_Y_MIN
#define _SELFTEST_Y_MIN
Definition: wizard_config.h:23
MARLIN_VAR_POS_X
#define MARLIN_VAR_POS_X
Definition: marlin_vars.h:15
selftest_fans_axis_screen_t::text_x_axis
window_text_t text_x_axis
Definition: selftest_fans_axis.h:24
_TEST_FAILED
Definition: wizard_types.h:88
wizard_ui.h
window_destroy_children
void window_destroy_children(int16_t id)
Definition: window.c:157
selftest_fans_axis_screen_t::icon_print_fan
window_icon_t icon_print_fan
Definition: selftest_fans_axis.h:28
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
WIZARD_MARGIN_LEFT
#define WIZARD_MARGIN_LEFT
Definition: wizard_ui.h:8
axisY
static const _cl_st_ax axisY
Definition: selftest_fans_axis.c:306
selftest_fans_axis_screen_t::text_print_fan
window_text_t text_print_fan
Definition: selftest_fans_axis.h:22
_SELFTEST_FAN1_MAX
#define _SELFTEST_FAN1_MAX
Definition: wizard_config.h:16
marlin_stop_processing
void marlin_stop_processing(void)
Definition: marlin_client.c:166
max
#define max(a, b)
Definition: wiring_constants.h:40
_TEST_STATE_t
_TEST_STATE_t
Definition: wizard_types.h:84
state
static volatile fsensor_t state
Definition: filament_sensor.c:23
window_set_icon_id
void window_set_icon_id(int16_t id, uint16_t id_res)
Definition: window.c:659
selftest_fans_axis_screen_t::text_z_axis
window_text_t text_z_axis
Definition: selftest_fans_axis.h:26
_SELFTEST_X_MIN
#define _SELFTEST_X_MIN
Definition: wizard_config.h:18
wizard_selftest_y
int wizard_selftest_y(int16_t id_body, selftest_fans_axis_screen_t *p_screen, selftest_fans_axis_data_t *p_data)
Definition: selftest_fans_axis.c:367
_window_icon_t
Definition: window_icon.h:11
dbg.h
selftest_phase
int(* selftest_phase)(selftest_fans_axis_data_t *p_data, uint8_t *state, int axis, int fr, int min, int max, int dir, char achar, float pos)
Definition: selftest_fans_axis.c:128
F
#define F(str)
Definition: UHS_macros.h:164
window_show
void window_show(int16_t id)
Definition: window.c:529
_SELFTEST_Y_TIME
#define _SELFTEST_Y_TIME
Definition: wizard_config.h:26
selftest_fans_axis_screen_t::progress_fan
window_progress_t progress_fan
Definition: selftest_fans_axis.h:18
selftest_fans_axis_data_t::axis_max
float axis_max[3]
Definition: selftest_fans_axis.h:46
Z_home_gcode
constexpr const char Z_home_gcode[]
Definition: menu_vars.cpp:88
Tacho_FAN1
uint32_t Tacho_FAN1
Definition: main.c:153
_SELFTEST_X_TIME
#define _SELFTEST_X_TIME
Definition: wizard_config.h:21
ph_prepare_to_move_to_max
static int ph_prepare_to_move_to_max(selftest_fans_axis_data_t *p_data, uint8_t *state, int axis, int fr, int min, int max, int dir, char achar, float pos)
Definition: selftest_fans_axis.c:146
_window_t::id
int16_t id
Definition: window.h:79
_SELFTEST_X_MAX
#define _SELFTEST_X_MAX
Definition: wizard_config.h:19
wizard_selftest_fan1
int wizard_selftest_fan1(int16_t id_body, selftest_fans_axis_screen_t *p_screen, selftest_fans_axis_data_t *p_data)
Definition: selftest_fans_axis.c:99
selftest_fans_axis_data_t::state_x
_TEST_STATE_t state_x
Definition: selftest_fans_axis.h:41
wizard_selftest_z
int wizard_selftest_z(int16_t id_body, selftest_fans_axis_screen_t *p_screen, selftest_fans_axis_data_t *p_data)
Definition: selftest_fans_axis.c:378
wizard_selftest_y
int wizard_selftest_y(int16_t id_body, selftest_fans_axis_screen_t *p_screen, selftest_fans_axis_data_t *p_data)
Definition: selftest_fans_axis.c:367
_window_icon_t::win
window_t win
Definition: window_icon.h:12
WIZARD_X_SPACE
#define WIZARD_X_SPACE
Definition: wizard_ui.h:10
wizard_selftest_axis
void wizard_selftest_axis(const _cl_st_ax *_ths, selftest_fans_axis_data_t *p_data, uint8_t *state, int axis, int fr, int min, int max, int dir)
Definition: selftest_fans_axis.c:339
axisX
static const _cl_st_ax axisX
Definition: selftest_fans_axis.c:285
window_set_text
void window_set_text(int16_t id, const char *text)
Definition: window.c:340
ph_finish
static int ph_finish(selftest_fans_axis_data_t *p_data, uint8_t *state, int axis, int fr, int min, int max, int dir, char achar, float pos)
Definition: selftest_fans_axis.c:217
min
#define min(a, b)
Definition: wiring_constants.h:36
marlin_motion
int marlin_motion(void)
Definition: marlin_client.c:182
_SELFTEST_FAN0_MAX
#define _SELFTEST_FAN0_MAX
Definition: wizard_config.h:12
ph_restore_Zaxis
static int ph_restore_Zaxis(selftest_fans_axis_data_t *p_data, uint8_t *state, int axis, int fr, int min, int max, int dir, char achar, float pos)
Definition: selftest_fans_axis.c:254
wizard_selftest_z
int wizard_selftest_z(int16_t id_body, selftest_fans_axis_screen_t *p_screen, selftest_fans_axis_data_t *p_data)
Definition: selftest_fans_axis.c:378
WINDOW_CLS_PROGRESS
#define WINDOW_CLS_PROGRESS
Definition: window.h:20
MARLIN_EVT_CommandEnd
#define MARLIN_EVT_CommandEnd
Definition: marlin_events.h:34
_SELFTEST_Z_MIN
#define _SELFTEST_Z_MIN
Definition: wizard_config.h:28
selftest_fans_axis_screen_t::text_extruder_fan
window_text_t text_extruder_fan
Definition: selftest_fans_axis.h:21
_SELFTEST_Z_FR
#define _SELFTEST_Z_FR
Definition: wizard_config.h:30
_SELFTEST_Y_FR
#define _SELFTEST_Y_FR
Definition: wizard_config.h:25
ph_home_axis
static int ph_home_axis(selftest_fans_axis_data_t *p_data, uint8_t *state, int axis, int fr, int min, int max, int dir, char achar, float pos)
Definition: selftest_fans_axis.c:224
window_set_value
void window_set_value(int16_t id, float value)
Definition: window.c:363
selftest_fans_axis_screen_t::progress_axis
window_progress_t progress_axis
Definition: selftest_fans_axis.h:19
_SELFTEST_FAN1_MIN
#define _SELFTEST_FAN1_MIN
Definition: wizard_config.h:15
marlin_busy
int marlin_busy(void)
Definition: marlin_client.c:152
selftest_fans_axis_screen_t::text_fan_test
window_text_t text_fan_test
Definition: selftest_fans_axis.h:20
phasesX
static const selftest_phase phasesX[]
Definition: selftest_fans_axis.c:268
selftest_fans_axis_screen_t::timer0
uint32_t timer0
Definition: selftest_fans_axis.h:32
wizard_selftest_fan0
int wizard_selftest_fan0(int16_t id_body, selftest_fans_axis_screen_t *p_screen, selftest_fans_axis_data_t *p_data)
Definition: selftest_fans_axis.c:81
selftest_fans_axis_data_t::axis_min
float axis_min[3]
Definition: selftest_fans_axis.h:45
selftest_fans_axis_screen_t::text_y_axis
window_text_t text_y_axis
Definition: selftest_fans_axis.h:25
marlin_gcode
void marlin_gcode(const char *gcode)
Definition: marlin_client.c:195
_cl_st_ax
Definition: selftest_fans_axis.c:131
marlin_update_vars
marlin_vars_t * marlin_update_vars(uint64_t msk)
Definition: marlin_client.c:368
hwio_fan_set_pwm
void hwio_fan_set_pwm(int i_fan, int val)
Definition: hwio_a3ides_2209_02.c:447
selftest_fans_axis_screen_t::icon_x_axis
window_icon_t icon_x_axis
Definition: selftest_fans_axis.h:29
_SELFTEST_FAN1_TIME
#define _SELFTEST_FAN1_TIME
Definition: wizard_config.h:14
wizard_selftest_fan1
int wizard_selftest_fan1(int16_t id_body, selftest_fans_axis_screen_t *p_screen, selftest_fans_axis_data_t *p_data)
Definition: selftest_fans_axis.c:99
uint8_t
const uint8_t[]
Definition: 404_html.c:3
_dbg
#define _dbg(...)
Definition: dbg.h:50
selftest_fans_axis_screen_t::icon_z_axis
window_icon_t icon_z_axis
Definition: selftest_fans_axis.h:31
MARLIN_VAR_MSK
#define MARLIN_VAR_MSK(v_id)
Definition: marlin_vars.h:35
_SELFTEST_Y_MAX
#define _SELFTEST_Y_MAX
Definition: wizard_config.h:24
WINDOW_CLS_ICON
#define WINDOW_CLS_ICON
Definition: window.h:12
_WIZ_TIMER_AUTOPASS
Definition: wizard_ui.h:20
selftest_fans_axis_data_t::state_fan0
_TEST_STATE_t state_fan0
Definition: selftest_fans_axis.h:39
axisZ
static const _cl_st_ax axisZ
Definition: selftest_fans_axis.c:335
WINDOW_CLS_TEXT
#define WINDOW_CLS_TEXT
Definition: window.h:10
_TEST_START
Definition: wizard_types.h:85
wizard_selftest_fan0
int wizard_selftest_fan0(int16_t id_body, selftest_fans_axis_screen_t *p_screen, selftest_fans_axis_data_t *p_data)
Definition: selftest_fans_axis.c:81
_axis_char
const char _axis_char[4]
Definition: selftest_fans_axis.c:117
selftest_fans_axis_screen_t
Definition: selftest_fans_axis.h:16
ph_move_to_min
static int ph_move_to_min(selftest_fans_axis_data_t *p_data, uint8_t *state, int axis, int fr, int min, int max, int dir, char achar, float pos)
Definition: selftest_fans_axis.c:169
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
wizard_selftest_x
int wizard_selftest_x(int16_t id_body, selftest_fans_axis_screen_t *p_screen, selftest_fans_axis_data_t *p_data)
Definition: selftest_fans_axis.c:356
selftest_fans_axis_data_t::state_fan1
_TEST_STATE_t state_fan1
Definition: selftest_fans_axis.h:40
wizard_init_screen_selftest_fans_axis
void wizard_init_screen_selftest_fans_axis(int16_t id_body, selftest_fans_axis_screen_t *p_screen, selftest_fans_axis_data_t *p_data)
Definition: selftest_fans_axis.c:14
selftest_fans_axis_screen_t::icon_y_axis
window_icon_t icon_y_axis
Definition: selftest_fans_axis.h:30
wizard_get_test_icon_resource
uint16_t wizard_get_test_icon_resource(uint8_t state)
Definition: wizard_ui.c:10
selftest_fans_axis_screen_t::icon_extruder_fan
window_icon_t icon_extruder_fan
Definition: selftest_fans_axis.h:27
marlin_start_processing
void marlin_start_processing(void)
Definition: marlin_client.c:174
selftest_fans_axis_data_t
Definition: selftest_fans_axis.h:37
ph_init
static int ph_init(selftest_fans_axis_data_t *p_data, uint8_t *state, int axis, int fr, int min, int max, int dir, char achar, float pos)
Definition: selftest_fans_axis.c:138
_SELFTEST_X_FR
#define _SELFTEST_X_FR
Definition: wizard_config.h:20
ph_restore_Yaxis
static int ph_restore_Yaxis(selftest_fans_axis_data_t *p_data, uint8_t *state, int axis, int fr, int min, int max, int dir, char achar, float pos)
Definition: selftest_fans_axis.c:247
createSpeedLookupTable.int
int
Definition: createSpeedLookupTable.py:15
wizard_timer
int wizard_timer(uint32_t *p_timer, uint32_t delay_ms, _TEST_STATE_t *pstate, _WIZ_TIMER_t type)
Definition: wizard_ui.c:58
selftest_fans_axis_screen_t::text_checking_axis
window_text_t text_checking_axis
Definition: selftest_fans_axis.h:23
config.h
phasesZ
static const selftest_phase phasesZ[]
Definition: selftest_fans_axis.c:311
_marlin_vars_t::pos
float pos[4]
Definition: marlin_vars.h:82
ph_wait_autohome
static int ph_wait_autohome(selftest_fans_axis_data_t *p_data, uint8_t *state, int axis, int fr, int min, int max, int dir, char achar, float pos)
Definition: selftest_fans_axis.c:261
hwio_a3ides.h
gui.h
ph_measure_min
static int ph_measure_min(selftest_fans_axis_data_t *p_data, uint8_t *state, int axis, int fr, int min, int max, int dir, char achar, float pos)
Definition: selftest_fans_axis.c:179
_SELFTEST_FAN0_MIN
#define _SELFTEST_FAN0_MIN
Definition: wizard_config.h:11
ph_measure_max
static int ph_measure_max(selftest_fans_axis_data_t *p_data, uint8_t *state, int axis, int fr, int min, int max, int dir, char achar, float pos)
Definition: selftest_fans_axis.c:198
_window_progress_t::win
window_t win
Definition: window_progress.h:16
_window_progress_t
Definition: window_progress.h:15
Tacho_FAN0
uint32_t Tacho_FAN0
Definition: main.c:152
wizard_update_test_icon
void wizard_update_test_icon(int16_t win_id, uint8_t state)
Definition: wizard_ui.c:24
marlin_gcode_printf
int marlin_gcode_printf(const char *format,...)
Definition: marlin_client.c:206
wizard_config.h
ph_restore_Xaxis
static int ph_restore_Xaxis(selftest_fans_axis_data_t *p_data, uint8_t *state, int axis, int fr, int min, int max, int dir, char achar, float pos)
Definition: selftest_fans_axis.c:240
_WIZ_TIMER
Definition: wizard_ui.h:19
phasesY
static const selftest_phase phasesY[]
Definition: selftest_fans_axis.c:289
_TEST_PASSED
Definition: wizard_types.h:87
wizard_selftest_x
int wizard_selftest_x(int16_t id_body, selftest_fans_axis_screen_t *p_screen, selftest_fans_axis_data_t *p_data)
Definition: selftest_fans_axis.c:356
marlin_event_clr
int marlin_event_clr(uint8_t evt_id)
Definition: marlin_client.c:252
ph_home_all_axis
static int ph_home_all_axis(selftest_fans_axis_data_t *p_data, uint8_t *state, int axis, int fr, int min, int max, int dir, char achar, float pos)
Definition: selftest_fans_axis.c:232
_SELFTEST_FAN0_TIME
#define _SELFTEST_FAN0_TIME
Definition: wizard_config.h:10
wizard_init_screen_selftest_fans_axis
void wizard_init_screen_selftest_fans_axis(int16_t id_body, selftest_fans_axis_screen_t *p_screen, selftest_fans_axis_data_t *p_data)
Definition: selftest_fans_axis.c:14
_cl_st_ax::p_phases
const selftest_phase * p_phases
Definition: selftest_fans_axis.c:134
ph_move_to_max
static int ph_move_to_max(selftest_fans_axis_data_t *p_data, uint8_t *state, int axis, int fr, int min, int max, int dir, char achar, float pos)
Definition: selftest_fans_axis.c:153