Browse Source

Shared function for menu_edit_* and menu_edit_callback_*

Scott Lahteine 9 years ago
parent
commit
2af559cca3
1 changed files with 3 additions and 4 deletions
  1. 3
    4
      Marlin/ultralcd.cpp

+ 3
- 4
Marlin/ultralcd.cpp View File

1025
 }
1025
 }
1026
 
1026
 
1027
 #define menu_edit_type(_type, _name, _strFunc, scale) \
1027
 #define menu_edit_type(_type, _name, _strFunc, scale) \
1028
-  bool menu_edit_ ## _name () { \
1028
+  bool _menu_edit_ ## _name () { \
1029
     bool isClicked = LCD_CLICKED; \
1029
     bool isClicked = LCD_CLICKED; \
1030
     if ((int32_t)encoderPosition < 0) encoderPosition = 0; \
1030
     if ((int32_t)encoderPosition < 0) encoderPosition = 0; \
1031
     if ((int32_t)encoderPosition > maxEditValue) encoderPosition = maxEditValue; \
1031
     if ((int32_t)encoderPosition > maxEditValue) encoderPosition = maxEditValue; \
1037
     } \
1037
     } \
1038
     return isClicked; \
1038
     return isClicked; \
1039
   } \
1039
   } \
1040
-  void menu_edit_callback_ ## _name () { \
1041
-    if (menu_edit_ ## _name ()) (*callbackFunc)(); \
1042
-  } \
1040
+  void menu_edit_ ## _name () { _menu_edit_ ## _name(); } \
1041
+  void menu_edit_callback_ ## _name () { if (_menu_edit_ ## _name ()) (*callbackFunc)(); } \
1043
   static void _menu_action_setting_edit_ ## _name (const char* pstr, _type* ptr, _type minValue, _type maxValue) { \
1042
   static void _menu_action_setting_edit_ ## _name (const char* pstr, _type* ptr, _type minValue, _type maxValue) { \
1044
     prevMenu = currentMenu; \
1043
     prevMenu = currentMenu; \
1045
     prevEncoderPosition = encoderPosition; \
1044
     prevEncoderPosition = encoderPosition; \

Loading…
Cancel
Save