|
|
@ -281,35 +281,35 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to |
|
|
|
* menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) |
|
|
|
* |
|
|
|
*/ |
|
|
|
#define _MENU_ITEM_PART_1(TYPE, LABEL, ARGS...) \ |
|
|
|
#define _MENU_ITEM_PART_1(TYPE, LABEL, ...) \ |
|
|
|
if (_menuLineNr == _thisItemNr) { \ |
|
|
|
if (lcdDrawUpdate) \ |
|
|
|
lcd_implementation_drawmenu_ ## TYPE(encoderLine == _thisItemNr, _lcdLineNr, PSTR(LABEL), ## ARGS); \ |
|
|
|
lcd_implementation_drawmenu_ ## TYPE(encoderLine == _thisItemNr, _lcdLineNr, PSTR(LABEL), ## __VA_ARGS__); \ |
|
|
|
if (wasClicked && encoderLine == _thisItemNr) { \ |
|
|
|
lcd_quick_feedback() |
|
|
|
|
|
|
|
#define _MENU_ITEM_PART_2(TYPE, ARGS...) \ |
|
|
|
menu_action_ ## TYPE(ARGS); \ |
|
|
|
#define _MENU_ITEM_PART_2(TYPE, ...) \ |
|
|
|
menu_action_ ## TYPE(__VA_ARGS__); \ |
|
|
|
return; \ |
|
|
|
} \ |
|
|
|
} \ |
|
|
|
++_thisItemNr |
|
|
|
|
|
|
|
#define MENU_ITEM(TYPE, LABEL, ARGS...) do { \ |
|
|
|
#define MENU_ITEM(TYPE, LABEL, ...) do { \ |
|
|
|
_skipStatic = false; \ |
|
|
|
_MENU_ITEM_PART_1(TYPE, LABEL, ## ARGS); \ |
|
|
|
_MENU_ITEM_PART_2(TYPE, ## ARGS); \ |
|
|
|
_MENU_ITEM_PART_1(TYPE, LABEL, ## __VA_ARGS__); \ |
|
|
|
_MENU_ITEM_PART_2(TYPE, ## __VA_ARGS__); \ |
|
|
|
} while(0) |
|
|
|
|
|
|
|
// Used to print static text with no visible cursor.
|
|
|
|
#define STATIC_ITEM(LABEL, ARGS...) \ |
|
|
|
#define STATIC_ITEM(LABEL, ...) \ |
|
|
|
if (_menuLineNr == _thisItemNr) { \ |
|
|
|
if (_skipStatic && encoderLine <= _thisItemNr) { \ |
|
|
|
encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \ |
|
|
|
lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; \ |
|
|
|
} \ |
|
|
|
if (lcdDrawUpdate) \ |
|
|
|
lcd_implementation_drawmenu_static(_lcdLineNr, PSTR(LABEL), ## ARGS); \ |
|
|
|
lcd_implementation_drawmenu_static(_lcdLineNr, PSTR(LABEL), ## __VA_ARGS__); \ |
|
|
|
} \ |
|
|
|
++_thisItemNr |
|
|
|
|
|
|
@ -329,24 +329,24 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to |
|
|
|
/**
|
|
|
|
* MENU_MULTIPLIER_ITEM generates drawing and handling code for a multiplier menu item |
|
|
|
*/ |
|
|
|
#define MENU_MULTIPLIER_ITEM(type, label, args...) do { \ |
|
|
|
_MENU_ITEM_PART_1(type, label, ## args); \ |
|
|
|
#define MENU_MULTIPLIER_ITEM(type, label, ...) do { \ |
|
|
|
_MENU_ITEM_PART_1(type, label, ## __VA_ARGS__); \ |
|
|
|
encoderRateMultiplierEnabled = true; \ |
|
|
|
lastEncoderMovementMillis = 0; \ |
|
|
|
_MENU_ITEM_PART_2(type, ## args); \ |
|
|
|
_MENU_ITEM_PART_2(type, ## __VA_ARGS__); \ |
|
|
|
} while(0) |
|
|
|
|
|
|
|
#endif //ENCODER_RATE_MULTIPLIER
|
|
|
|
|
|
|
|
#define MENU_ITEM_DUMMY() do { _thisItemNr++; } while(0) |
|
|
|
#define MENU_ITEM_EDIT(type, label, args...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label), ## args) |
|
|
|
#define MENU_ITEM_EDIT_CALLBACK(type, label, args...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## args) |
|
|
|
#define MENU_ITEM_EDIT(type, label, ...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label), ## __VA_ARGS__) |
|
|
|
#define MENU_ITEM_EDIT_CALLBACK(type, label, ...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## __VA_ARGS__) |
|
|
|
#if ENABLED(ENCODER_RATE_MULTIPLIER) |
|
|
|
#define MENU_MULTIPLIER_ITEM_EDIT(type, label, args...) MENU_MULTIPLIER_ITEM(setting_edit_ ## type, label, PSTR(label), ## args) |
|
|
|
#define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, args...) MENU_MULTIPLIER_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## args) |
|
|
|
#define MENU_MULTIPLIER_ITEM_EDIT(type, label, ...) MENU_MULTIPLIER_ITEM(setting_edit_ ## type, label, PSTR(label), ## __VA_ARGS__) |
|
|
|
#define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, ...) MENU_MULTIPLIER_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## __VA_ARGS__) |
|
|
|
#else //!ENCODER_RATE_MULTIPLIER
|
|
|
|
#define MENU_MULTIPLIER_ITEM_EDIT(type, label, args...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label), ## args) |
|
|
|
#define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, args...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## args) |
|
|
|
#define MENU_MULTIPLIER_ITEM_EDIT(type, label, ...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label), ## __VA_ARGS__) |
|
|
|
#define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, ...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## __VA_ARGS__) |
|
|
|
#endif //!ENCODER_RATE_MULTIPLIER
|
|
|
|
|
|
|
|
/** Used variables to keep track of the menu */ |
|
|
|