Prusa MINI Firmware overview
|
#include "selftest.h"
#include "dbg.h"
#include "config.h"
#include "hwio_a3ides.h"
#include "marlin_client.h"
#include "wizard_config.h"
#include "wizard_ui.h"
|
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) |
|
int | wizard_selftest_fan0 (int16_t id_body, selftest_fans_axis_screen_t *p_screen, selftest_fans_axis_data_t *p_data) |
|
int | wizard_selftest_fan1 (int16_t id_body, selftest_fans_axis_screen_t *p_screen, selftest_fans_axis_data_t *p_data) |
|
static float | _get_pos (int axis) |
|
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) |
|
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) |
|
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) |
|
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) |
|
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) |
|
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) |
|
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) |
|
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) |
|
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) |
|
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) |
|
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) |
|
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) |
|
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) |
|
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) |
|
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) |
|
int | wizard_selftest_x (int16_t id_body, selftest_fans_axis_screen_t *p_screen, selftest_fans_axis_data_t *p_data) |
|
int | wizard_selftest_y (int16_t id_body, selftest_fans_axis_screen_t *p_screen, selftest_fans_axis_data_t *p_data) |
|
int | wizard_selftest_z (int16_t id_body, selftest_fans_axis_screen_t *p_screen, selftest_fans_axis_data_t *p_data) |
|
◆ selftest_phase
◆ wizard_init_screen_selftest_fans_axis()
◆ wizard_selftest_fan0()
89 if (progress == 100) {
◆ wizard_selftest_fan1()
107 if (progress == 100) {
◆ _get_pos()
static float _get_pos |
( |
int |
axis | ) |
|
|
static |
◆ ph_init()
◆ 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 |
|
) |
| |
|
static |
◆ ph_move_to_max()
◆ ph_wait_motion()
◆ ph_move_to_min()
◆ ph_measure_min()
181 float dis = dir * (p_data->
axis_min[axis] - pos);
182 _dbg(
"dis = %.3f", (
double)dis);
183 if ((
int)(dis + 0.5
F) >=
max)
185 _dbg(
"endstop not reached");
189 if ((
int)(dis + 0.5
F) <=
min)
191 _dbg(
"distance to short");
◆ ph_measure_max()
200 float dis = dir * (pos - p_data->
axis_max[axis]);
201 _dbg(
"dis = %.3f", (
double)dis);
202 if ((
int)(dis + 0.5
F) >=
max)
204 _dbg(
"endstop not reached");
208 if ((
int)(dis + 0.5
F) <=
min)
210 _dbg(
"distance to short");
◆ ph_finish()
◆ ph_home_axis()
◆ ph_home_all_axis()
◆ ph_restore_Xaxis()
◆ ph_restore_Yaxis()
◆ ph_restore_Zaxis()
◆ ph_wait_autohome()
◆ wizard_selftest_axis()
348 if ( ((
size_t)phase) >= _ths->
sz) {
◆ wizard_selftest_x()
◆ wizard_selftest_y()
◆ wizard_selftest_z()
◆ Tacho_FAN0
◆ Tacho_FAN1
◆ _axis_char
const char _axis_char[4] = { 'X', 'Y', 'Z', 'E' } |
◆ phasesX
◆ axisX
◆ phasesY
◆ axisY
◆ phasesZ
◆ axisZ
#define _SELFTEST_Z_TIME
Definition: wizard_config.h:31
_TEST_STATE_t state_y
Definition: selftest_fans_axis.h:42
int marlin_wait_motion(uint32_t timeout)
Definition: marlin_client.c:187
_TEST_STATE_t state_z
Definition: selftest_fans_axis.h:43
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
#define _SELFTEST_Z_MAX
Definition: wizard_config.h:29
static float _get_pos(int axis)
Definition: selftest_fans_axis.c:120
const size_t sz
Definition: selftest_fans_axis.c:133
#define _SELFTEST_Y_MIN
Definition: wizard_config.h:23
#define MARLIN_VAR_POS_X
Definition: marlin_vars.h:15
window_text_t text_x_axis
Definition: selftest_fans_axis.h:24
Definition: wizard_types.h:88
void window_destroy_children(int16_t id)
Definition: window.c:157
window_icon_t icon_print_fan
Definition: selftest_fans_axis.h:28
void window_invalidate(int16_t id)
Definition: window.c:304
static rect_ui16_t rect_ui16(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
Definition: guitypes.h:159
#define WIZARD_MARGIN_LEFT
Definition: wizard_ui.h:8
static const _cl_st_ax axisY
Definition: selftest_fans_axis.c:306
window_text_t text_print_fan
Definition: selftest_fans_axis.h:22
#define _SELFTEST_FAN1_MAX
Definition: wizard_config.h:16
void marlin_stop_processing(void)
Definition: marlin_client.c:166
#define max(a, b)
Definition: wiring_constants.h:40
static volatile fsensor_t state
Definition: filament_sensor.c:23
void window_set_icon_id(int16_t id, uint16_t id_res)
Definition: window.c:659
window_text_t text_z_axis
Definition: selftest_fans_axis.h:26
#define _SELFTEST_X_MIN
Definition: wizard_config.h:18
#define F(str)
Definition: UHS_macros.h:164
void window_show(int16_t id)
Definition: window.c:529
#define _SELFTEST_Y_TIME
Definition: wizard_config.h:26
window_progress_t progress_fan
Definition: selftest_fans_axis.h:18
float axis_max[3]
Definition: selftest_fans_axis.h:46
uint32_t Tacho_FAN1
Definition: main.c:153
#define _SELFTEST_X_TIME
Definition: wizard_config.h:21
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
int16_t id
Definition: window.h:79
#define _SELFTEST_X_MAX
Definition: wizard_config.h:19
_TEST_STATE_t state_x
Definition: selftest_fans_axis.h:41
window_t win
Definition: window_icon.h:12
#define WIZARD_X_SPACE
Definition: wizard_ui.h:10
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
static const _cl_st_ax axisX
Definition: selftest_fans_axis.c:285
void window_set_text(int16_t id, const char *text)
Definition: window.c:340
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
#define min(a, b)
Definition: wiring_constants.h:36
int marlin_motion(void)
Definition: marlin_client.c:182
#define _SELFTEST_FAN0_MAX
Definition: wizard_config.h:12
#define WINDOW_CLS_PROGRESS
Definition: window.h:20
#define MARLIN_EVT_CommandEnd
Definition: marlin_events.h:34
#define _SELFTEST_Z_MIN
Definition: wizard_config.h:28
window_text_t text_extruder_fan
Definition: selftest_fans_axis.h:21
#define _SELFTEST_Z_FR
Definition: wizard_config.h:30
#define _SELFTEST_Y_FR
Definition: wizard_config.h:25
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
void window_set_value(int16_t id, float value)
Definition: window.c:363
window_progress_t progress_axis
Definition: selftest_fans_axis.h:19
#define _SELFTEST_FAN1_MIN
Definition: wizard_config.h:15
int marlin_busy(void)
Definition: marlin_client.c:152
window_text_t text_fan_test
Definition: selftest_fans_axis.h:20
static const selftest_phase phasesX[]
Definition: selftest_fans_axis.c:268
uint32_t timer0
Definition: selftest_fans_axis.h:32
float axis_min[3]
Definition: selftest_fans_axis.h:45
window_text_t text_y_axis
Definition: selftest_fans_axis.h:25
void marlin_gcode(const char *gcode)
Definition: marlin_client.c:195
marlin_vars_t * marlin_update_vars(uint64_t msk)
Definition: marlin_client.c:368
void hwio_fan_set_pwm(int i_fan, int val)
Definition: hwio_a3ides_2209_02.c:447
window_icon_t icon_x_axis
Definition: selftest_fans_axis.h:29
#define _SELFTEST_FAN1_TIME
Definition: wizard_config.h:14
const uint8_t[]
Definition: 404_html.c:3
#define _dbg(...)
Definition: dbg.h:50
window_icon_t icon_z_axis
Definition: selftest_fans_axis.h:31
#define MARLIN_VAR_MSK(v_id)
Definition: marlin_vars.h:35
#define _SELFTEST_Y_MAX
Definition: wizard_config.h:24
#define WINDOW_CLS_ICON
Definition: window.h:12
Definition: wizard_ui.h:20
_TEST_STATE_t state_fan0
Definition: selftest_fans_axis.h:39
static const _cl_st_ax axisZ
Definition: selftest_fans_axis.c:335
#define WINDOW_CLS_TEXT
Definition: window.h:10
Definition: wizard_types.h:85
const char _axis_char[4]
Definition: selftest_fans_axis.c:117
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
int16_t window_create_ptr(int16_t cls_id, int16_t id_parent, rect_ui16_t rect, void *ptr)
Definition: window.c:102
_TEST_STATE_t state_fan1
Definition: selftest_fans_axis.h:40
window_icon_t icon_y_axis
Definition: selftest_fans_axis.h:30
uint16_t wizard_get_test_icon_resource(uint8_t state)
Definition: wizard_ui.c:10
window_icon_t icon_extruder_fan
Definition: selftest_fans_axis.h:27
void marlin_start_processing(void)
Definition: marlin_client.c:174
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
#define _SELFTEST_X_FR
Definition: wizard_config.h:20
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
int wizard_timer(uint32_t *p_timer, uint32_t delay_ms, _TEST_STATE_t *pstate, _WIZ_TIMER_t type)
Definition: wizard_ui.c:58
window_text_t text_checking_axis
Definition: selftest_fans_axis.h:23
static const selftest_phase phasesZ[]
Definition: selftest_fans_axis.c:311
float pos[4]
Definition: marlin_vars.h:82
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
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
#define _SELFTEST_FAN0_MIN
Definition: wizard_config.h:11
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_t win
Definition: window_progress.h:16
uint32_t Tacho_FAN0
Definition: main.c:152
void wizard_update_test_icon(int16_t win_id, uint8_t state)
Definition: wizard_ui.c:24
int marlin_gcode_printf(const char *format,...)
Definition: marlin_client.c:206
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
Definition: wizard_ui.h:19
static const selftest_phase phasesY[]
Definition: selftest_fans_axis.c:289
Definition: wizard_types.h:87
int marlin_event_clr(uint8_t evt_id)
Definition: marlin_client.c:252
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
#define _SELFTEST_FAN0_TIME
Definition: wizard_config.h:10
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
const selftest_phase * p_phases
Definition: selftest_fans_axis.c:134
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