|
@@ -281,35 +281,35 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to
|
281
|
281
|
* menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999)
|
282
|
282
|
*
|
283
|
283
|
*/
|
284
|
|
- #define _MENU_ITEM_PART_1(TYPE, LABEL, ARGS...) \
|
|
284
|
+ #define _MENU_ITEM_PART_1(TYPE, LABEL, ...) \
|
285
|
285
|
if (_menuLineNr == _thisItemNr) { \
|
286
|
286
|
if (lcdDrawUpdate) \
|
287
|
|
- lcd_implementation_drawmenu_ ## TYPE(encoderLine == _thisItemNr, _lcdLineNr, PSTR(LABEL), ## ARGS); \
|
|
287
|
+ lcd_implementation_drawmenu_ ## TYPE(encoderLine == _thisItemNr, _lcdLineNr, PSTR(LABEL), ## __VA_ARGS__); \
|
288
|
288
|
if (wasClicked && encoderLine == _thisItemNr) { \
|
289
|
289
|
lcd_quick_feedback()
|
290
|
290
|
|
291
|
|
- #define _MENU_ITEM_PART_2(TYPE, ARGS...) \
|
292
|
|
- menu_action_ ## TYPE(ARGS); \
|
|
291
|
+ #define _MENU_ITEM_PART_2(TYPE, ...) \
|
|
292
|
+ menu_action_ ## TYPE(__VA_ARGS__); \
|
293
|
293
|
return; \
|
294
|
294
|
} \
|
295
|
295
|
} \
|
296
|
296
|
++_thisItemNr
|
297
|
297
|
|
298
|
|
- #define MENU_ITEM(TYPE, LABEL, ARGS...) do { \
|
|
298
|
+ #define MENU_ITEM(TYPE, LABEL, ...) do { \
|
299
|
299
|
_skipStatic = false; \
|
300
|
|
- _MENU_ITEM_PART_1(TYPE, LABEL, ## ARGS); \
|
301
|
|
- _MENU_ITEM_PART_2(TYPE, ## ARGS); \
|
|
300
|
+ _MENU_ITEM_PART_1(TYPE, LABEL, ## __VA_ARGS__); \
|
|
301
|
+ _MENU_ITEM_PART_2(TYPE, ## __VA_ARGS__); \
|
302
|
302
|
} while(0)
|
303
|
303
|
|
304
|
304
|
// Used to print static text with no visible cursor.
|
305
|
|
- #define STATIC_ITEM(LABEL, ARGS...) \
|
|
305
|
+ #define STATIC_ITEM(LABEL, ...) \
|
306
|
306
|
if (_menuLineNr == _thisItemNr) { \
|
307
|
307
|
if (_skipStatic && encoderLine <= _thisItemNr) { \
|
308
|
308
|
encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \
|
309
|
309
|
lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; \
|
310
|
310
|
} \
|
311
|
311
|
if (lcdDrawUpdate) \
|
312
|
|
- lcd_implementation_drawmenu_static(_lcdLineNr, PSTR(LABEL), ## ARGS); \
|
|
312
|
+ lcd_implementation_drawmenu_static(_lcdLineNr, PSTR(LABEL), ## __VA_ARGS__); \
|
313
|
313
|
} \
|
314
|
314
|
++_thisItemNr
|
315
|
315
|
|
|
@@ -329,24 +329,24 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to
|
329
|
329
|
/**
|
330
|
330
|
* MENU_MULTIPLIER_ITEM generates drawing and handling code for a multiplier menu item
|
331
|
331
|
*/
|
332
|
|
- #define MENU_MULTIPLIER_ITEM(type, label, args...) do { \
|
333
|
|
- _MENU_ITEM_PART_1(type, label, ## args); \
|
|
332
|
+ #define MENU_MULTIPLIER_ITEM(type, label, ...) do { \
|
|
333
|
+ _MENU_ITEM_PART_1(type, label, ## __VA_ARGS__); \
|
334
|
334
|
encoderRateMultiplierEnabled = true; \
|
335
|
335
|
lastEncoderMovementMillis = 0; \
|
336
|
|
- _MENU_ITEM_PART_2(type, ## args); \
|
|
336
|
+ _MENU_ITEM_PART_2(type, ## __VA_ARGS__); \
|
337
|
337
|
} while(0)
|
338
|
338
|
|
339
|
339
|
#endif //ENCODER_RATE_MULTIPLIER
|
340
|
340
|
|
341
|
341
|
#define MENU_ITEM_DUMMY() do { _thisItemNr++; } while(0)
|
342
|
|
- #define MENU_ITEM_EDIT(type, label, args...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label), ## args)
|
343
|
|
- #define MENU_ITEM_EDIT_CALLBACK(type, label, args...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## args)
|
|
342
|
+ #define MENU_ITEM_EDIT(type, label, ...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label), ## __VA_ARGS__)
|
|
343
|
+ #define MENU_ITEM_EDIT_CALLBACK(type, label, ...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## __VA_ARGS__)
|
344
|
344
|
#if ENABLED(ENCODER_RATE_MULTIPLIER)
|
345
|
|
- #define MENU_MULTIPLIER_ITEM_EDIT(type, label, args...) MENU_MULTIPLIER_ITEM(setting_edit_ ## type, label, PSTR(label), ## args)
|
346
|
|
- #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, args...) MENU_MULTIPLIER_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## args)
|
|
345
|
+ #define MENU_MULTIPLIER_ITEM_EDIT(type, label, ...) MENU_MULTIPLIER_ITEM(setting_edit_ ## type, label, PSTR(label), ## __VA_ARGS__)
|
|
346
|
+ #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, ...) MENU_MULTIPLIER_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## __VA_ARGS__)
|
347
|
347
|
#else //!ENCODER_RATE_MULTIPLIER
|
348
|
|
- #define MENU_MULTIPLIER_ITEM_EDIT(type, label, args...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label), ## args)
|
349
|
|
- #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, args...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## args)
|
|
348
|
+ #define MENU_MULTIPLIER_ITEM_EDIT(type, label, ...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label), ## __VA_ARGS__)
|
|
349
|
+ #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, ...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## __VA_ARGS__)
|
350
|
350
|
#endif //!ENCODER_RATE_MULTIPLIER
|
351
|
351
|
|
352
|
352
|
/** Used variables to keep track of the menu */
|