Browse Source

Merge pull request #5062 from thinkyhead/rc_warnings_fix

Warnings fixed redux
Scott Lahteine 8 years ago
parent
commit
3544c3632f

+ 2
- 2
Marlin/Conditionals_post.h View File

306
   /**
306
   /**
307
    * ARRAY_BY_EXTRUDERS based on EXTRUDERS
307
    * ARRAY_BY_EXTRUDERS based on EXTRUDERS
308
    */
308
    */
309
-  #define ARRAY_BY_EXTRUDERS(args...) ARRAY_N(EXTRUDERS, args)
309
+  #define ARRAY_BY_EXTRUDERS(...) ARRAY_N(EXTRUDERS, __VA_ARGS__)
310
   #define ARRAY_BY_EXTRUDERS1(v1) ARRAY_BY_EXTRUDERS(v1, v1, v1, v1, v1, v1)
310
   #define ARRAY_BY_EXTRUDERS1(v1) ARRAY_BY_EXTRUDERS(v1, v1, v1, v1, v1, v1)
311
 
311
 
312
   /**
312
   /**
313
    * ARRAY_BY_HOTENDS based on HOTENDS
313
    * ARRAY_BY_HOTENDS based on HOTENDS
314
    */
314
    */
315
-  #define ARRAY_BY_HOTENDS(args...) ARRAY_N(HOTENDS, args)
315
+  #define ARRAY_BY_HOTENDS(...) ARRAY_N(HOTENDS, __VA_ARGS__)
316
   #define ARRAY_BY_HOTENDS1(v1) ARRAY_BY_HOTENDS(v1, v1, v1, v1, v1, v1)
316
   #define ARRAY_BY_HOTENDS1(v1) ARRAY_BY_HOTENDS(v1, v1, v1, v1, v1, v1)
317
 
317
 
318
   /**
318
   /**

+ 9
- 9
Marlin/Marlin_main.cpp View File

634
   static inline type pgm_read_any(const type *p)  \
634
   static inline type pgm_read_any(const type *p)  \
635
   { return pgm_read_##reader##_near(p); }
635
   { return pgm_read_##reader##_near(p); }
636
 
636
 
637
-DEFINE_PGM_READ_ANY(float,       float);
638
-DEFINE_PGM_READ_ANY(signed char, byte);
637
+DEFINE_PGM_READ_ANY(float,       float)
638
+DEFINE_PGM_READ_ANY(signed char, byte)
639
 
639
 
640
 #define XYZ_CONSTS_FROM_CONFIG(type, array, CONFIG) \
640
 #define XYZ_CONSTS_FROM_CONFIG(type, array, CONFIG) \
641
   static const PROGMEM type array##_P[XYZ] =        \
641
   static const PROGMEM type array##_P[XYZ] =        \
643
   static inline type array(int axis)          \
643
   static inline type array(int axis)          \
644
   { return pgm_read_any(&array##_P[axis]); }
644
   { return pgm_read_any(&array##_P[axis]); }
645
 
645
 
646
-XYZ_CONSTS_FROM_CONFIG(float, base_min_pos,   MIN_POS);
647
-XYZ_CONSTS_FROM_CONFIG(float, base_max_pos,   MAX_POS);
648
-XYZ_CONSTS_FROM_CONFIG(float, base_home_pos,  HOME_POS);
649
-XYZ_CONSTS_FROM_CONFIG(float, max_length,     MAX_LENGTH);
650
-XYZ_CONSTS_FROM_CONFIG(float, home_bump_mm,   HOME_BUMP_MM);
651
-XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR);
646
+XYZ_CONSTS_FROM_CONFIG(float, base_min_pos,   MIN_POS)
647
+XYZ_CONSTS_FROM_CONFIG(float, base_max_pos,   MAX_POS)
648
+XYZ_CONSTS_FROM_CONFIG(float, base_home_pos,  HOME_POS)
649
+XYZ_CONSTS_FROM_CONFIG(float, max_length,     MAX_LENGTH)
650
+XYZ_CONSTS_FROM_CONFIG(float, home_bump_mm,   HOME_BUMP_MM)
651
+XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR)
652
 
652
 
653
 /**
653
 /**
654
  * ***************************************************************************
654
  * ***************************************************************************
8542
     cartes[X_AXIS] = delta_tower1_x + ex[0] * Xnew + ey[0] * Ynew - ez[0] * Znew;
8542
     cartes[X_AXIS] = delta_tower1_x + ex[0] * Xnew + ey[0] * Ynew - ez[0] * Znew;
8543
     cartes[Y_AXIS] = delta_tower1_y + ex[1] * Xnew + ey[1] * Ynew - ez[1] * Znew;
8543
     cartes[Y_AXIS] = delta_tower1_y + ex[1] * Xnew + ey[1] * Ynew - ez[1] * Znew;
8544
     cartes[Z_AXIS] =             z1 + ex[2] * Xnew + ey[2] * Ynew - ez[2] * Znew;
8544
     cartes[Z_AXIS] =             z1 + ex[2] * Xnew + ey[2] * Ynew - ez[2] * Znew;
8545
-  };
8545
+  }
8546
 
8546
 
8547
   void forward_kinematics_DELTA(float point[ABC]) {
8547
   void forward_kinematics_DELTA(float point[ABC]) {
8548
     forward_kinematics_DELTA(point[A_AXIS], point[B_AXIS], point[C_AXIS]);
8548
     forward_kinematics_DELTA(point[A_AXIS], point[B_AXIS], point[C_AXIS]);

+ 2
- 1
Marlin/buzzer.h View File

109
         this->tick();
109
         this->tick();
110
         thermalManager.manage_heater();
110
         thermalManager.manage_heater();
111
       }
111
       }
112
-      this->buffer.enqueue((tone_t) { duration, frequency });
112
+      tone_t tone = { duration, frequency };
113
+      this->buffer.enqueue(tone);
113
     }
114
     }
114
 
115
 
115
     /**
116
     /**

+ 9
- 9
Marlin/macros.h View File

81
 #define ZERO(a) memset(a,0,sizeof(a))
81
 #define ZERO(a) memset(a,0,sizeof(a))
82
 
82
 
83
 // Macros for initializing arrays
83
 // Macros for initializing arrays
84
-#define ARRAY_6(v1, v2, v3, v4, v5, v6, args...) { v1, v2, v3, v4, v5, v6 }
85
-#define ARRAY_5(v1, v2, v3, v4, v5, args...)     { v1, v2, v3, v4, v5 }
86
-#define ARRAY_4(v1, v2, v3, v4, args...)         { v1, v2, v3, v4 }
87
-#define ARRAY_3(v1, v2, v3, args...)             { v1, v2, v3 }
88
-#define ARRAY_2(v1, v2, args...)                 { v1, v2 }
89
-#define ARRAY_1(v1, args...)                     { v1 }
90
-
91
-#define _ARRAY_N(N, args...) ARRAY_ ##N(args)
92
-#define ARRAY_N(N, args...) _ARRAY_N(N, args)
84
+#define ARRAY_6(v1, v2, v3, v4, v5, v6, ...) { v1, v2, v3, v4, v5, v6 }
85
+#define ARRAY_5(v1, v2, v3, v4, v5, ...)     { v1, v2, v3, v4, v5 }
86
+#define ARRAY_4(v1, v2, v3, v4, ...)         { v1, v2, v3, v4 }
87
+#define ARRAY_3(v1, v2, v3, ...)             { v1, v2, v3 }
88
+#define ARRAY_2(v1, v2, ...)                 { v1, v2 }
89
+#define ARRAY_1(v1, ...)                     { v1 }
90
+
91
+#define _ARRAY_N(N, ...) ARRAY_ ##N(__VA_ARGS__)
92
+#define ARRAY_N(N, ...) _ARRAY_N(N, __VA_ARGS__)
93
 
93
 
94
 // Macros for adding
94
 // Macros for adding
95
 #define INC_0 1
95
 #define INC_0 1

+ 68
- 63
Marlin/ultralcd.cpp View File

169
   typedef void (*screenFunc_t)();
169
   typedef void (*screenFunc_t)();
170
 
170
 
171
   // Different types of actions that can be used in menu items.
171
   // Different types of actions that can be used in menu items.
172
-  static void menu_action_back();
172
+  #define menu_action_back(dummy) _menu_action_back()
173
+  static void _menu_action_back();
173
   static void menu_action_submenu(screenFunc_t data);
174
   static void menu_action_submenu(screenFunc_t data);
174
   static void menu_action_gcode(const char* pgcode);
175
   static void menu_action_gcode(const char* pgcode);
175
   static void menu_action_function(screenFunc_t data);
176
   static void menu_action_function(screenFunc_t data);
267
    *   menu_action_[type](arg3...)
268
    *   menu_action_[type](arg3...)
268
    *
269
    *
269
    * Examples:
270
    * Examples:
270
-   *   MENU_ITEM(back, MSG_WATCH)
271
+   *   MENU_ITEM(back, MSG_WATCH, 0 [dummy parameter] )
272
+   *   or
273
+   *   MENU_BACK(MSG_WATCH)
271
    *     lcd_implementation_drawmenu_back(sel, row, PSTR(MSG_WATCH))
274
    *     lcd_implementation_drawmenu_back(sel, row, PSTR(MSG_WATCH))
272
    *     menu_action_back()
275
    *     menu_action_back()
273
    *
276
    *
281
    *     menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999)
284
    *     menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999)
282
    *
285
    *
283
    */
286
    */
284
-  #define _MENU_ITEM_PART_1(TYPE, LABEL, ARGS...) \
287
+  #define _MENU_ITEM_PART_1(TYPE, LABEL, ...) \
285
     if (_menuLineNr == _thisItemNr) { \
288
     if (_menuLineNr == _thisItemNr) { \
286
       if (lcdDrawUpdate) \
289
       if (lcdDrawUpdate) \
287
-        lcd_implementation_drawmenu_ ## TYPE(encoderLine == _thisItemNr, _lcdLineNr, PSTR(LABEL), ## ARGS); \
290
+        lcd_implementation_drawmenu_ ## TYPE(encoderLine == _thisItemNr, _lcdLineNr, PSTR(LABEL), ## __VA_ARGS__); \
288
       if (wasClicked && encoderLine == _thisItemNr) { \
291
       if (wasClicked && encoderLine == _thisItemNr) { \
289
         lcd_quick_feedback()
292
         lcd_quick_feedback()
290
 
293
 
291
-  #define _MENU_ITEM_PART_2(TYPE, ARGS...) \
292
-        menu_action_ ## TYPE(ARGS); \
294
+  #define _MENU_ITEM_PART_2(TYPE, ...) \
295
+        menu_action_ ## TYPE(__VA_ARGS__); \
293
         return; \
296
         return; \
294
       } \
297
       } \
295
     } \
298
     } \
296
     ++_thisItemNr
299
     ++_thisItemNr
297
 
300
 
298
-  #define MENU_ITEM(TYPE, LABEL, ARGS...) do { \
301
+  #define MENU_ITEM(TYPE, LABEL, ...) do { \
299
       _skipStatic = false; \
302
       _skipStatic = false; \
300
-      _MENU_ITEM_PART_1(TYPE, LABEL, ## ARGS); \
301
-      _MENU_ITEM_PART_2(TYPE, ## ARGS); \
303
+      _MENU_ITEM_PART_1(TYPE, LABEL, ## __VA_ARGS__); \
304
+      _MENU_ITEM_PART_2(TYPE, ## __VA_ARGS__); \
302
     } while(0)
305
     } while(0)
303
 
306
 
307
+  #define MENU_BACK(LABEL) MENU_ITEM(back, LABEL, 0)
308
+
304
   // Used to print static text with no visible cursor.
309
   // Used to print static text with no visible cursor.
305
-  #define STATIC_ITEM(LABEL, ARGS...) \
310
+  #define STATIC_ITEM(LABEL, ...) \
306
     if (_menuLineNr == _thisItemNr) { \
311
     if (_menuLineNr == _thisItemNr) { \
307
       if (_skipStatic && encoderLine <= _thisItemNr) { \
312
       if (_skipStatic && encoderLine <= _thisItemNr) { \
308
         encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \
313
         encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \
309
         lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; \
314
         lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; \
310
       } \
315
       } \
311
       if (lcdDrawUpdate) \
316
       if (lcdDrawUpdate) \
312
-        lcd_implementation_drawmenu_static(_lcdLineNr, PSTR(LABEL), ## ARGS); \
317
+        lcd_implementation_drawmenu_static(_lcdLineNr, PSTR(LABEL), ## __VA_ARGS__); \
313
     } \
318
     } \
314
     ++_thisItemNr
319
     ++_thisItemNr
315
 
320
 
329
     /**
334
     /**
330
      * MENU_MULTIPLIER_ITEM generates drawing and handling code for a multiplier menu item
335
      * MENU_MULTIPLIER_ITEM generates drawing and handling code for a multiplier menu item
331
      */
336
      */
332
-    #define MENU_MULTIPLIER_ITEM(type, label, args...) do { \
333
-        _MENU_ITEM_PART_1(type, label, ## args); \
337
+    #define MENU_MULTIPLIER_ITEM(type, label, ...) do { \
338
+        _MENU_ITEM_PART_1(type, label, ## __VA_ARGS__); \
334
         encoderRateMultiplierEnabled = true; \
339
         encoderRateMultiplierEnabled = true; \
335
         lastEncoderMovementMillis = 0; \
340
         lastEncoderMovementMillis = 0; \
336
-        _MENU_ITEM_PART_2(type, ## args); \
341
+        _MENU_ITEM_PART_2(type, ## __VA_ARGS__); \
337
       } while(0)
342
       } while(0)
338
 
343
 
339
   #endif //ENCODER_RATE_MULTIPLIER
344
   #endif //ENCODER_RATE_MULTIPLIER
340
 
345
 
341
   #define MENU_ITEM_DUMMY() do { _thisItemNr++; } while(0)
346
   #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)
347
+  #define MENU_ITEM_EDIT(type, label, ...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label), ## __VA_ARGS__)
348
+  #define MENU_ITEM_EDIT_CALLBACK(type, label, ...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## __VA_ARGS__)
344
   #if ENABLED(ENCODER_RATE_MULTIPLIER)
349
   #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)
350
+    #define MENU_MULTIPLIER_ITEM_EDIT(type, label, ...) MENU_MULTIPLIER_ITEM(setting_edit_ ## type, label, PSTR(label), ## __VA_ARGS__)
351
+    #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, ...) MENU_MULTIPLIER_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## __VA_ARGS__)
347
   #else //!ENCODER_RATE_MULTIPLIER
352
   #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)
353
+    #define MENU_MULTIPLIER_ITEM_EDIT(type, label, ...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label), ## __VA_ARGS__)
354
+    #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, ...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## __VA_ARGS__)
350
   #endif //!ENCODER_RATE_MULTIPLIER
355
   #endif //!ENCODER_RATE_MULTIPLIER
351
 
356
 
352
   /** Used variables to keep track of the menu */
357
   /** Used variables to keep track of the menu */
602
 
607
 
603
   static void lcd_main_menu() {
608
   static void lcd_main_menu() {
604
     START_MENU();
609
     START_MENU();
605
-    MENU_ITEM(back, MSG_WATCH);
610
+    MENU_BACK(MSG_WATCH);
606
 
611
 
607
     #if ENABLED(BLTOUCH)
612
     #if ENABLED(BLTOUCH)
608
       if (!endstops.z_probe_enabled && TEST_BLTOUCH())
613
       if (!endstops.z_probe_enabled && TEST_BLTOUCH())
749
     //
754
     //
750
     // ^ Main
755
     // ^ Main
751
     //
756
     //
752
-    MENU_ITEM(back, MSG_MAIN);
757
+    MENU_BACK(MSG_MAIN);
753
 
758
 
754
     //
759
     //
755
     // Speed:
760
     // Speed:
874
     static void lcd_dac_menu() {
879
     static void lcd_dac_menu() {
875
       dac_driver_getValues();
880
       dac_driver_getValues();
876
       START_MENU();    
881
       START_MENU();    
877
-      MENU_ITEM(back, MSG_CONTROL);
882
+      MENU_BACK(MSG_CONTROL);
878
       MENU_ITEM_EDIT_CALLBACK(int3, MSG_X " " MSG_DAC_PERCENT, &driverPercent[X_AXIS], 0, 100, dac_driver_commit);
883
       MENU_ITEM_EDIT_CALLBACK(int3, MSG_X " " MSG_DAC_PERCENT, &driverPercent[X_AXIS], 0, 100, dac_driver_commit);
879
       MENU_ITEM_EDIT_CALLBACK(int3, MSG_Y " " MSG_DAC_PERCENT, &driverPercent[Y_AXIS], 0, 100, dac_driver_commit);
884
       MENU_ITEM_EDIT_CALLBACK(int3, MSG_Y " " MSG_DAC_PERCENT, &driverPercent[Y_AXIS], 0, 100, dac_driver_commit);
880
       MENU_ITEM_EDIT_CALLBACK(int3, MSG_Z " " MSG_DAC_PERCENT, &driverPercent[Z_AXIS], 0, 100, dac_driver_commit);
885
       MENU_ITEM_EDIT_CALLBACK(int3, MSG_Z " " MSG_DAC_PERCENT, &driverPercent[Z_AXIS], 0, 100, dac_driver_commit);
961
 
966
 
962
     static void lcd_preheat_pla_menu() {
967
     static void lcd_preheat_pla_menu() {
963
       START_MENU();
968
       START_MENU();
964
-      MENU_ITEM(back, MSG_PREPARE);
969
+      MENU_BACK(MSG_PREPARE);
965
       #if HOTENDS == 1
970
       #if HOTENDS == 1
966
         MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_pla0);
971
         MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_pla0);
967
       #else
972
       #else
983
 
988
 
984
     static void lcd_preheat_abs_menu() {
989
     static void lcd_preheat_abs_menu() {
985
       START_MENU();
990
       START_MENU();
986
-      MENU_ITEM(back, MSG_PREPARE);
991
+      MENU_BACK(MSG_PREPARE);
987
       #if HOTENDS == 1
992
       #if HOTENDS == 1
988
         MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_abs0);
993
         MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_abs0);
989
       #else
994
       #else
1210
      */
1215
      */
1211
     static void lcd_level_bed() {
1216
     static void lcd_level_bed() {
1212
       START_MENU();
1217
       START_MENU();
1213
-      MENU_ITEM(back, MSG_LEVEL_BED_CANCEL);
1218
+      MENU_BACK(MSG_LEVEL_BED_CANCEL);
1214
       MENU_ITEM(submenu, MSG_LEVEL_BED, _lcd_level_bed_continue);
1219
       MENU_ITEM(submenu, MSG_LEVEL_BED, _lcd_level_bed_continue);
1215
       END_MENU();
1220
       END_MENU();
1216
     }
1221
     }
1229
     //
1234
     //
1230
     // ^ Main
1235
     // ^ Main
1231
     //
1236
     //
1232
-    MENU_ITEM(back, MSG_MAIN);
1237
+    MENU_BACK(MSG_MAIN);
1233
 
1238
 
1234
     //
1239
     //
1235
     // Auto Home
1240
     // Auto Home
1333
 
1338
 
1334
     static void lcd_delta_calibrate_menu() {
1339
     static void lcd_delta_calibrate_menu() {
1335
       START_MENU();
1340
       START_MENU();
1336
-      MENU_ITEM(back, MSG_MAIN);
1341
+      MENU_BACK(MSG_MAIN);
1337
       MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
1342
       MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
1338
       MENU_ITEM(function, MSG_DELTA_CALIBRATE_X, _goto_tower_x);
1343
       MENU_ITEM(function, MSG_DELTA_CALIBRATE_X, _goto_tower_x);
1339
       MENU_ITEM(function, MSG_DELTA_CALIBRATE_Y, _goto_tower_y);
1344
       MENU_ITEM(function, MSG_DELTA_CALIBRATE_Y, _goto_tower_y);
1478
 
1483
 
1479
   static void _lcd_move_menu_axis() {
1484
   static void _lcd_move_menu_axis() {
1480
     START_MENU();
1485
     START_MENU();
1481
-    MENU_ITEM(back, MSG_MOVE_AXIS);
1486
+    MENU_BACK(MSG_MOVE_AXIS);
1482
 
1487
 
1483
     if (_MOVE_XYZ_ALLOWED) {
1488
     if (_MOVE_XYZ_ALLOWED) {
1484
       MENU_ITEM(submenu, MSG_MOVE_X, lcd_move_x);
1489
       MENU_ITEM(submenu, MSG_MOVE_X, lcd_move_x);
1531
 
1536
 
1532
   static void lcd_move_menu() {
1537
   static void lcd_move_menu() {
1533
     START_MENU();
1538
     START_MENU();
1534
-    MENU_ITEM(back, MSG_PREPARE);
1539
+    MENU_BACK(MSG_PREPARE);
1535
 
1540
 
1536
     if (_MOVE_XYZ_ALLOWED)
1541
     if (_MOVE_XYZ_ALLOWED)
1537
       MENU_ITEM(submenu, MSG_MOVE_10MM, lcd_move_menu_10mm);
1542
       MENU_ITEM(submenu, MSG_MOVE_10MM, lcd_move_menu_10mm);
1550
 
1555
 
1551
   static void lcd_control_menu() {
1556
   static void lcd_control_menu() {
1552
     START_MENU();
1557
     START_MENU();
1553
-    MENU_ITEM(back, MSG_MAIN);
1558
+    MENU_BACK(MSG_MAIN);
1554
     MENU_ITEM(submenu, MSG_TEMPERATURE, lcd_control_temperature_menu);
1559
     MENU_ITEM(submenu, MSG_TEMPERATURE, lcd_control_temperature_menu);
1555
     MENU_ITEM(submenu, MSG_MOTION, lcd_control_motion_menu);
1560
     MENU_ITEM(submenu, MSG_MOTION, lcd_control_motion_menu);
1556
     MENU_ITEM(submenu, MSG_VOLUMETRIC, lcd_control_volumetric_menu);
1561
     MENU_ITEM(submenu, MSG_VOLUMETRIC, lcd_control_volumetric_menu);
1637
       #define _PIDTEMP_FUNCTIONS(eindex) _PIDTEMP_BASE_FUNCTIONS(eindex)
1642
       #define _PIDTEMP_FUNCTIONS(eindex) _PIDTEMP_BASE_FUNCTIONS(eindex)
1638
     #endif
1643
     #endif
1639
 
1644
 
1640
-    _PIDTEMP_FUNCTIONS(0);
1645
+    _PIDTEMP_FUNCTIONS(0)
1641
     #if ENABLED(PID_PARAMS_PER_HOTEND)
1646
     #if ENABLED(PID_PARAMS_PER_HOTEND)
1642
       #if HOTENDS > 1
1647
       #if HOTENDS > 1
1643
-        _PIDTEMP_FUNCTIONS(1);
1648
+        _PIDTEMP_FUNCTIONS(1)
1644
         #if HOTENDS > 2
1649
         #if HOTENDS > 2
1645
-          _PIDTEMP_FUNCTIONS(2);
1650
+          _PIDTEMP_FUNCTIONS(2)
1646
           #if HOTENDS > 3
1651
           #if HOTENDS > 3
1647
-            _PIDTEMP_FUNCTIONS(3);
1652
+            _PIDTEMP_FUNCTIONS(3)
1648
           #endif //HOTENDS > 3
1653
           #endif //HOTENDS > 3
1649
         #endif //HOTENDS > 2
1654
         #endif //HOTENDS > 2
1650
       #endif //HOTENDS > 1
1655
       #endif //HOTENDS > 1
1663
     //
1668
     //
1664
     // ^ Control
1669
     // ^ Control
1665
     //
1670
     //
1666
-    MENU_ITEM(back, MSG_CONTROL);
1671
+    MENU_BACK(MSG_CONTROL);
1667
 
1672
 
1668
     //
1673
     //
1669
     // Nozzle:
1674
     // Nozzle:
1795
    */
1800
    */
1796
   static void lcd_control_temperature_preheat_pla_settings_menu() {
1801
   static void lcd_control_temperature_preheat_pla_settings_menu() {
1797
     START_MENU();
1802
     START_MENU();
1798
-    MENU_ITEM(back, MSG_TEMPERATURE);
1803
+    MENU_BACK(MSG_TEMPERATURE);
1799
     MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &preheatFanSpeed1, 0, 255);
1804
     MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &preheatFanSpeed1, 0, 255);
1800
     #if TEMP_SENSOR_0 != 0
1805
     #if TEMP_SENSOR_0 != 0
1801
       MENU_ITEM_EDIT(int3, MSG_NOZZLE, &preheatHotendTemp1, HEATER_0_MINTEMP, HEATER_0_MAXTEMP - 15);
1806
       MENU_ITEM_EDIT(int3, MSG_NOZZLE, &preheatHotendTemp1, HEATER_0_MINTEMP, HEATER_0_MAXTEMP - 15);
1816
    */
1821
    */
1817
   static void lcd_control_temperature_preheat_abs_settings_menu() {
1822
   static void lcd_control_temperature_preheat_abs_settings_menu() {
1818
     START_MENU();
1823
     START_MENU();
1819
-    MENU_ITEM(back, MSG_TEMPERATURE);
1824
+    MENU_BACK(MSG_TEMPERATURE);
1820
     MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &preheatFanSpeed2, 0, 255);
1825
     MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &preheatFanSpeed2, 0, 255);
1821
     #if TEMP_SENSOR_0 != 0
1826
     #if TEMP_SENSOR_0 != 0
1822
       MENU_ITEM_EDIT(int3, MSG_NOZZLE, &preheatHotendTemp2, HEATER_0_MINTEMP, HEATER_0_MAXTEMP - 15);
1827
       MENU_ITEM_EDIT(int3, MSG_NOZZLE, &preheatHotendTemp2, HEATER_0_MINTEMP, HEATER_0_MAXTEMP - 15);
1840
    */
1845
    */
1841
   static void lcd_control_motion_menu() {
1846
   static void lcd_control_motion_menu() {
1842
     START_MENU();
1847
     START_MENU();
1843
-    MENU_ITEM(back, MSG_CONTROL);
1848
+    MENU_BACK(MSG_CONTROL);
1844
     #if HAS_BED_PROBE
1849
     #if HAS_BED_PROBE
1845
       MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
1850
       MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
1846
     #endif
1851
     #endif
1890
    */
1895
    */
1891
   static void lcd_control_volumetric_menu() {
1896
   static void lcd_control_volumetric_menu() {
1892
     START_MENU();
1897
     START_MENU();
1893
-    MENU_ITEM(back, MSG_CONTROL);
1898
+    MENU_BACK(MSG_CONTROL);
1894
 
1899
 
1895
     MENU_ITEM_EDIT_CALLBACK(bool, MSG_VOLUMETRIC_ENABLED, &volumetric_enabled, calculate_volumetric_multipliers);
1900
     MENU_ITEM_EDIT_CALLBACK(bool, MSG_VOLUMETRIC_ENABLED, &volumetric_enabled, calculate_volumetric_multipliers);
1896
 
1901
 
1947
 
1952
 
1948
     static void lcd_control_retract_menu() {
1953
     static void lcd_control_retract_menu() {
1949
       START_MENU();
1954
       START_MENU();
1950
-      MENU_ITEM(back, MSG_CONTROL);
1955
+      MENU_BACK(MSG_CONTROL);
1951
       MENU_ITEM_EDIT(bool, MSG_AUTORETRACT, &autoretract_enabled);
1956
       MENU_ITEM_EDIT(bool, MSG_AUTORETRACT, &autoretract_enabled);
1952
       MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT, &retract_length, 0, 100);
1957
       MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT, &retract_length, 0, 100);
1953
       #if EXTRUDERS > 1
1958
       #if EXTRUDERS > 1
1989
       if (lcdDrawUpdate == 0 && LCD_CLICKED == 0) return; // nothing to do (so don't thrash the SD card)
1994
       if (lcdDrawUpdate == 0 && LCD_CLICKED == 0) return; // nothing to do (so don't thrash the SD card)
1990
       uint16_t fileCnt = card.getnrfilenames();
1995
       uint16_t fileCnt = card.getnrfilenames();
1991
       START_MENU();
1996
       START_MENU();
1992
-      MENU_ITEM(back, MSG_MAIN);
1997
+      MENU_BACK(MSG_MAIN);
1993
       card.getWorkDirName();
1998
       card.getWorkDirName();
1994
       if (card.filename[0] == '/') {
1999
       if (card.filename[0] == '/') {
1995
         #if !PIN_EXISTS(SD_DETECT)
2000
         #if !PIN_EXISTS(SD_DETECT)
2120
     static void lcd_info_board_menu() {
2125
     static void lcd_info_board_menu() {
2121
       if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
2126
       if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
2122
       START_SCREEN();
2127
       START_SCREEN();
2123
-      STATIC_ITEM(BOARD_NAME, true, true);                     // MyPrinterController
2124
-      STATIC_ITEM(MSG_INFO_BAUDRATE ": " STRINGIFY(BAUDRATE)); // Baud: 250000
2125
-      STATIC_ITEM(MSG_INFO_PROTOCOL ": " PROTOCOL_VERSION);    // Protocol: 1.0
2128
+      STATIC_ITEM(BOARD_NAME, true, true);                           // MyPrinterController
2129
+      STATIC_ITEM(MSG_INFO_BAUDRATE ": " STRINGIFY(BAUDRATE), true); // Baud: 250000
2130
+      STATIC_ITEM(MSG_INFO_PROTOCOL ": " PROTOCOL_VERSION, true);    // Protocol: 1.0
2126
       #ifdef POWER_SUPPLY
2131
       #ifdef POWER_SUPPLY
2127
         #if (POWER_SUPPLY == 1)
2132
         #if (POWER_SUPPLY == 1)
2128
-          STATIC_ITEM(MSG_INFO_PSU ": ATX");  // Power Supply: ATX
2133
+          STATIC_ITEM(MSG_INFO_PSU ": ATX", true);  // Power Supply: ATX
2129
         #elif (POWER_SUPPLY == 2)
2134
         #elif (POWER_SUPPLY == 2)
2130
-          STATIC_ITEM(MSG_INFO_PSU ": XBox"); // Power Supply: XBox
2135
+          STATIC_ITEM(MSG_INFO_PSU ": XBox", true); // Power Supply: XBox
2131
         #endif
2136
         #endif
2132
       #endif // POWER_SUPPLY
2137
       #endif // POWER_SUPPLY
2133
       END_SCREEN();
2138
       END_SCREEN();
2141
     static void lcd_info_printer_menu() {
2146
     static void lcd_info_printer_menu() {
2142
       if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
2147
       if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
2143
       START_SCREEN();
2148
       START_SCREEN();
2144
-      STATIC_ITEM(MSG_MARLIN, true, true);                       // Marlin
2145
-      STATIC_ITEM(SHORT_BUILD_VERSION);                          // x.x.x-Branch
2146
-      STATIC_ITEM(STRING_DISTRIBUTION_DATE);                     // YYYY-MM-DD HH:MM
2147
-      STATIC_ITEM(MACHINE_NAME);                                 // My3DPrinter
2148
-      STATIC_ITEM(WEBSITE_URL);                                  // www.my3dprinter.com
2149
-      STATIC_ITEM(MSG_INFO_EXTRUDERS ": " STRINGIFY(EXTRUDERS)); // Extruders: 2
2149
+      STATIC_ITEM(MSG_MARLIN, true, true);                             // Marlin
2150
+      STATIC_ITEM(SHORT_BUILD_VERSION, true);                          // x.x.x-Branch
2151
+      STATIC_ITEM(STRING_DISTRIBUTION_DATE, true);                     // YYYY-MM-DD HH:MM
2152
+      STATIC_ITEM(MACHINE_NAME, true);                                 // My3DPrinter
2153
+      STATIC_ITEM(WEBSITE_URL, true);                                  // www.my3dprinter.com
2154
+      STATIC_ITEM(MSG_INFO_EXTRUDERS ": " STRINGIFY(EXTRUDERS), true); // Extruders: 2
2150
       END_SCREEN();
2155
       END_SCREEN();
2151
     }
2156
     }
2152
 
2157
 
2157
      */
2162
      */
2158
     static void lcd_info_menu() {
2163
     static void lcd_info_menu() {
2159
       START_MENU();
2164
       START_MENU();
2160
-      MENU_ITEM(back, MSG_MAIN);
2165
+      MENU_BACK(MSG_MAIN);
2161
       MENU_ITEM(submenu, MSG_INFO_PRINTER_MENU, lcd_info_printer_menu);        // Printer Info >
2166
       MENU_ITEM(submenu, MSG_INFO_PRINTER_MENU, lcd_info_printer_menu);        // Printer Info >
2162
       MENU_ITEM(submenu, MSG_INFO_BOARD_MENU, lcd_info_board_menu);            // Board Info >
2167
       MENU_ITEM(submenu, MSG_INFO_BOARD_MENU, lcd_info_board_menu);            // Board Info >
2163
       MENU_ITEM(submenu, MSG_INFO_THERMISTOR_MENU, lcd_info_thermistors_menu); // Thermistors >
2168
       MENU_ITEM(submenu, MSG_INFO_THERMISTOR_MENU, lcd_info_thermistors_menu); // Thermistors >
2363
       callbackFunc = callback; \
2368
       callbackFunc = callback; \
2364
     }
2369
     }
2365
 
2370
 
2366
-  menu_edit_type(int, int3, itostr3, 1);
2367
-  menu_edit_type(float, float3, ftostr3, 1);
2368
-  menu_edit_type(float, float32, ftostr32, 100);
2369
-  menu_edit_type(float, float43, ftostr43sign, 1000);
2370
-  menu_edit_type(float, float5, ftostr5rj, 0.01);
2371
-  menu_edit_type(float, float51, ftostr51sign, 10);
2372
-  menu_edit_type(float, float52, ftostr52sign, 100);
2373
-  menu_edit_type(unsigned long, long5, ftostr5rj, 0.01);
2371
+  menu_edit_type(int, int3, itostr3, 1)
2372
+  menu_edit_type(float, float3, ftostr3, 1)
2373
+  menu_edit_type(float, float32, ftostr32, 100)
2374
+  menu_edit_type(float, float43, ftostr43sign, 1000)
2375
+  menu_edit_type(float, float5, ftostr5rj, 0.01)
2376
+  menu_edit_type(float, float51, ftostr51sign, 10)
2377
+  menu_edit_type(float, float52, ftostr52sign, 100)
2378
+  menu_edit_type(unsigned long, long5, ftostr5rj, 0.01)
2374
 
2379
 
2375
   /**
2380
   /**
2376
    *
2381
    *
2431
    * Menu actions
2436
    * Menu actions
2432
    *
2437
    *
2433
    */
2438
    */
2434
-  static void menu_action_back() { lcd_goto_previous_menu(); }
2439
+  static void _menu_action_back() { lcd_goto_previous_menu(); }
2435
   static void menu_action_submenu(screenFunc_t func) { lcd_save_previous_menu(); lcd_goto_screen(func); }
2440
   static void menu_action_submenu(screenFunc_t func) { lcd_save_previous_menu(); lcd_goto_screen(func); }
2436
   static void menu_action_gcode(const char* pgcode) { enqueue_and_echo_commands_P(pgcode); }
2441
   static void menu_action_gcode(const char* pgcode) { enqueue_and_echo_commands_P(pgcode); }
2437
   static void menu_action_function(screenFunc_t func) { (*func)(); }
2442
   static void menu_action_function(screenFunc_t func) { (*func)(); }

+ 1
- 1
Marlin/ultralcd_impl_DOGM.h View File

550
   }
550
   }
551
 
551
 
552
   // Macros for specific types of menu items
552
   // Macros for specific types of menu items
553
-  #define lcd_implementation_drawmenu_back(sel, row, pstr) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0])
553
+  #define lcd_implementation_drawmenu_back(sel, row, pstr, dummy) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0])
554
   #define lcd_implementation_drawmenu_submenu(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0])
554
   #define lcd_implementation_drawmenu_submenu(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0])
555
   #define lcd_implementation_drawmenu_gcode(sel, row, pstr, gcode) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')
555
   #define lcd_implementation_drawmenu_gcode(sel, row, pstr, gcode) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')
556
   #define lcd_implementation_drawmenu_function(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')
556
   #define lcd_implementation_drawmenu_function(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')

+ 1
- 1
Marlin/ultralcd_impl_HD44780.h View File

911
 
911
 
912
   #endif // SDSUPPORT
912
   #endif // SDSUPPORT
913
 
913
 
914
-  #define lcd_implementation_drawmenu_back(sel, row, pstr) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0])
914
+  #define lcd_implementation_drawmenu_back(sel, row, pstr, dummy) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0])
915
   #define lcd_implementation_drawmenu_submenu(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0])
915
   #define lcd_implementation_drawmenu_submenu(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0])
916
   #define lcd_implementation_drawmenu_gcode(sel, row, pstr, gcode) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')
916
   #define lcd_implementation_drawmenu_gcode(sel, row, pstr, gcode) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')
917
   #define lcd_implementation_drawmenu_function(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')
917
   #define lcd_implementation_drawmenu_function(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')

Loading…
Cancel
Save