Prusa MINI Firmware overview
wizard_types.h
Go to the documentation of this file.
1 // wizard_types.h
2 #ifndef _WIZARD_TYPES
3 #define _WIZARD_TYPES
4 
5 #include <assert.h>
6 
7 typedef enum {
12 
25 
38 
47 
50 
51 static_assert(_STATE_LAST < 64, "too many states in wizard_state_t");
52 
53 #define _STATE_MASK(state) (((uint64_t)1) << state)
54 
55 #define _STATE_MASK_WIZARD_START ( \
56  _STATE_MASK(_STATE_START) | _STATE_MASK(_STATE_INIT) | _STATE_MASK(_STATE_INFO) | _STATE_MASK(_STATE_FIRST))
57 
58 #define _STATE_MASK_SELFTEST ( \
59  _STATE_MASK(_STATE_SELFTEST_INIT) | _STATE_MASK(_STATE_SELFTEST_FAN0) | _STATE_MASK(_STATE_SELFTEST_FAN1) | _STATE_MASK(_STATE_SELFTEST_X) | _STATE_MASK(_STATE_SELFTEST_Y) | _STATE_MASK(_STATE_SELFTEST_Z) | _STATE_MASK(_STATE_SELFTEST_HOME) | _STATE_MASK(_STATE_SELFTEST_COOL) | _STATE_MASK(_STATE_SELFTEST_INIT_TEMP) | _STATE_MASK(_STATE_SELFTEST_TEMP) | _STATE_MASK(_STATE_SELFTEST_PASS) | _STATE_MASK(_STATE_SELFTEST_FAIL) | _STATE_MASK(_STATE_LAST))
60 
61 #define _STATE_MASK_XYZCALIB ( \
62  _STATE_MASK(_STATE_XYZCALIB_INIT) | _STATE_MASK(_STATE_XYZCALIB_HOME) | _STATE_MASK(_STATE_XYZCALIB_Z) | _STATE_MASK(_STATE_XYZCALIB_XY_MSG_CLEAN_NOZZLE) | _STATE_MASK(_STATE_XYZCALIB_XY_MSG_IS_SHEET) | _STATE_MASK(_STATE_XYZCALIB_XY_MSG_REMOVE_SHEET) | _STATE_MASK(_STATE_XYZCALIB_XY_MSG_PLACE_PAPER) | _STATE_MASK(_STATE_XYZCALIB_XY_SEARCH) | _STATE_MASK(_STATE_XYZCALIB_XY_MSG_PLACE_SHEET) | _STATE_MASK(_STATE_XYZCALIB_XY_MEASURE) | _STATE_MASK(_STATE_XYZCALIB_PASS) | _STATE_MASK(_STATE_XYZCALIB_FAIL) | _STATE_MASK(_STATE_LAST))
63 
64 #define _STATE_MASK_FIRSTLAY ( \
65  _STATE_MASK(_STATE_FIRSTLAY_INIT) | _STATE_MASK(_STATE_FIRSTLAY_LOAD) | _STATE_MASK(_STATE_FIRSTLAY_MSBX_CALIB) | _STATE_MASK(_STATE_FIRSTLAY_MSBX_START_PRINT) | _STATE_MASK(_STATE_FIRSTLAY_PRINT) | _STATE_MASK(_STATE_FIRSTLAY_MSBX_REPEAT_PRINT) | _STATE_MASK(_STATE_FIRSTLAY_FAIL) | _STATE_MASK(_STATE_LAST))
66 /*
67 #define _STATE_MASK_WIZARD ( \
68  _STATE_MASK_WIZARD_START | \
69  _STATE_MASK_SELFTEST | \
70  _STATE_MASK_XYZCALIB | \
71  _STATE_MASK_FIRSTLAY | \
72  _STATE_MASK(_STATE_FINISH) | \
73  _STATE_MASK(_STATE_LAST) )*/
74 
75 //disabled XYZ
76 #define _STATE_MASK_WIZARD (_STATE_MASK_WIZARD_START | _STATE_MASK_SELFTEST | _STATE_MASK_FIRSTLAY | _STATE_MASK(_STATE_FINISH) | _STATE_MASK(_STATE_LAST))
77 
78 #define _SCREEN_NONE 0
79 #define _SCREEN_SELFTEST_FANS_XYZ 1
80 #define _SCREEN_SELFTEST_HOME 2
81 #define _SCREEN_SELFTEST_TEMP 3
82 #define _SCREEN_XYZCALIB_HOME 4
83 
84 typedef enum {
90 
91 static inline int _is_test_done(int result) {
92  return (result == _TEST_PASSED) || (result == _TEST_FAILED);
93 }
94 
95 #endif //_SCREEN_WIZARD
_STATE_SELFTEST_Y
Definition: wizard_types.h:17
_STATE_LAST
Definition: wizard_types.h:48
_STATE_XYZCALIB_XY_MSG_PLACE_PAPER
Definition: wizard_types.h:32
_STATE_INFO
Definition: wizard_types.h:10
_STATE_XYZCALIB_XY_MSG_IS_SHEET
Definition: wizard_types.h:30
_STATE_FIRSTLAY_PRINT
Definition: wizard_types.h:43
_TEST_FAILED
Definition: wizard_types.h:88
_TEST_STATE_t
_TEST_STATE_t
Definition: wizard_types.h:84
_STATE_SELFTEST_Z
Definition: wizard_types.h:18
_is_test_done
static int _is_test_done(int result)
Definition: wizard_types.h:91
_STATE_FINISH
Definition: wizard_types.h:46
_STATE_SELFTEST_FAN1
Definition: wizard_types.h:15
_STATE_XYZCALIB_XY_MEASURE
Definition: wizard_types.h:35
_STATE_SELFTEST_COOL
Definition: wizard_types.h:20
_STATE_FIRSTLAY_MSBX_START_PRINT
Definition: wizard_types.h:42
_STATE_SELFTEST_INIT
Definition: wizard_types.h:13
_STATE_XYZCALIB_PASS
Definition: wizard_types.h:36
_STATE_XYZCALIB_XY_MSG_REMOVE_SHEET
Definition: wizard_types.h:31
_STATE_XYZCALIB_Z
Definition: wizard_types.h:28
_STATE_SELFTEST_HOME
Definition: wizard_types.h:19
_STATE_SELFTEST_X
Definition: wizard_types.h:16
_STATE_XYZCALIB_FAIL
Definition: wizard_types.h:37
_STATE_FIRSTLAY_FAIL
Definition: wizard_types.h:45
_STATE_FIRSTLAY_INIT
Definition: wizard_types.h:39
_STATE_SELFTEST_TEMP
Definition: wizard_types.h:22
_STATE_SELFTEST_INIT_TEMP
Definition: wizard_types.h:21
_STATE_FIRST
Definition: wizard_types.h:11
_TEST_RUN
Definition: wizard_types.h:86
_STATE_XYZCALIB_HOME
Definition: wizard_types.h:27
_STATE_FIRSTLAY_LOAD
Definition: wizard_types.h:40
_STATE_FIRSTLAY_MSBX_CALIB
Definition: wizard_types.h:41
_STATE_XYZCALIB_INIT
Definition: wizard_types.h:26
_TEST_START
Definition: wizard_types.h:85
_STATE_INIT
Definition: wizard_types.h:9
wizard_state_t
wizard_state_t
Definition: wizard_types.h:7
_STATE_START
Definition: wizard_types.h:8
_STATE_SELFTEST_PASS
Definition: wizard_types.h:23
_STATE_XYZCALIB_XY_MSG_CLEAN_NOZZLE
Definition: wizard_types.h:29
_STATE_FIRSTLAY_MSBX_REPEAT_PRINT
Definition: wizard_types.h:44
_STATE_XYZCALIB_XY_MSG_PLACE_SHEET
Definition: wizard_types.h:34
_STATE_SELFTEST_FAIL
Definition: wizard_types.h:24
_STATE_SELFTEST_FAN0
Definition: wizard_types.h:14
_TEST_PASSED
Definition: wizard_types.h:87
_STATE_XYZCALIB_XY_SEARCH
Definition: wizard_types.h:33