|
@@ -29,26 +29,23 @@ extern uint8_t menu_data[MENU_DATA_SIZE];
|
|
|
|
|
|
extern uint8_t menu_depth;
|
|
extern uint8_t menu_depth;
|
|
|
|
|
|
-//! definition of serious errors possibly blocking the main menu
|
|
+//! definition of reasons blocking the main menu
|
|
//! Use them as bit mask, so that the code may set various errors at the same time
|
|
//! Use them as bit mask, so that the code may set various errors at the same time
|
|
enum ESeriousErrors {
|
|
enum ESeriousErrors {
|
|
- SERIOUS_ERR_NONE = 0,
|
|
+ MENU_BLOCK_NONE = 0,
|
|
- SERIOUS_ERR_MINTEMP_HEATER = 0x01,
|
|
+ MENU_BLOCK_THERMAL_ERROR = 0x01,
|
|
- SERIOUS_ERR_MINTEMP_BED = 0x02
|
|
|
|
}; // and possibly others in the future.
|
|
}; // and possibly others in the future.
|
|
|
|
|
|
-//! this is a flag for disabling entering the main menu. If this is set
|
|
+//! this is a flag for disabling entering the main menu and longpress. If this is set to anything !=
|
|
-//! to anything != 0, the only the main status screen will be shown on the
|
|
+//! 0, the only the main status screen will be shown on the LCD and the user will be prevented from
|
|
-//! LCD and the user will be prevented from entering the menu.
|
|
+//! entering the menu.
|
|
-//! Now used only to block doing anything with the printer when there is
|
|
+extern uint8_t menu_block_mask;
|
|
-//! the infamous MINTEMP error (SERIOUS_ERR_MINTEMP).
|
|
|
|
-extern uint8_t menu_block_entering_on_serious_errors;
|
|
|
|
|
|
|
|
-//! a pair of macros for manipulating the serious errors
|
|
+//! a pair of macros for manipulating menu entry
|
|
//! a c++ class would have been better
|
|
//! a c++ class would have been better
|
|
-#define menu_set_serious_error(x) menu_block_entering_on_serious_errors |= x;
|
|
+#define menu_set_block(x) menu_block_mask |= x;
|
|
-#define menu_unset_serious_error(x) menu_block_entering_on_serious_errors &= ~x;
|
|
+#define menu_unset_block(x) menu_block_mask &= ~x;
|
|
-#define menu_is_serious_error(x) (menu_block_entering_on_serious_errors & x) != 0
|
|
+#define menu_is_blocked(x) (menu_block_mask & x) != 0
|
|
|
|
|
|
extern uint8_t menu_line;
|
|
extern uint8_t menu_line;
|
|
extern uint8_t menu_item;
|
|
extern uint8_t menu_item;
|