ソースを参照

fixed warning: ISO C99 requires rest arguments to be used

Josef Pavlik 8年前
コミット
d35dc407a8
3個のファイルの変更40行の追加35行の削除
  1. 38
    33
      Marlin/ultralcd.cpp
  2. 1
    1
      Marlin/ultralcd_impl_DOGM.h
  3. 1
    1
      Marlin/ultralcd_impl_HD44780.h

+ 38
- 33
Marlin/ultralcd.cpp ファイルの表示

@@ -169,7 +169,8 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to
169 169
   typedef void (*screenFunc_t)();
170 170
 
171 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 174
   static void menu_action_submenu(screenFunc_t data);
174 175
   static void menu_action_gcode(const char* pgcode);
175 176
   static void menu_action_function(screenFunc_t data);
@@ -267,7 +268,9 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to
267 268
    *   menu_action_[type](arg3...)
268 269
    *
269 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 274
    *     lcd_implementation_drawmenu_back(sel, row, PSTR(MSG_WATCH))
272 275
    *     menu_action_back()
273 276
    *
@@ -301,6 +304,8 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to
301 304
       _MENU_ITEM_PART_2(TYPE, ## __VA_ARGS__); \
302 305
     } while(0)
303 306
 
307
+  #define MENU_BACK(LABEL) MENU_ITEM(back, LABEL, 0)
308
+
304 309
   // Used to print static text with no visible cursor.
305 310
   #define STATIC_ITEM(LABEL, ...) \
306 311
     if (_menuLineNr == _thisItemNr) { \
@@ -602,7 +607,7 @@ void kill_screen(const char* lcd_msg) {
602 607
 
603 608
   static void lcd_main_menu() {
604 609
     START_MENU();
605
-    MENU_ITEM(back, MSG_WATCH);
610
+    MENU_BACK(MSG_WATCH);
606 611
 
607 612
     #if ENABLED(BLTOUCH)
608 613
       if (!endstops.z_probe_enabled && TEST_BLTOUCH())
@@ -749,7 +754,7 @@ void kill_screen(const char* lcd_msg) {
749 754
     //
750 755
     // ^ Main
751 756
     //
752
-    MENU_ITEM(back, MSG_MAIN);
757
+    MENU_BACK(MSG_MAIN);
753 758
 
754 759
     //
755 760
     // Speed:
@@ -874,7 +879,7 @@ void kill_screen(const char* lcd_msg) {
874 879
     static void lcd_dac_menu() {
875 880
       dac_driver_getValues();
876 881
       START_MENU();    
877
-      MENU_ITEM(back, MSG_CONTROL);
882
+      MENU_BACK(MSG_CONTROL);
878 883
       MENU_ITEM_EDIT_CALLBACK(int3, MSG_X " " MSG_DAC_PERCENT, &driverPercent[X_AXIS], 0, 100, dac_driver_commit);
879 884
       MENU_ITEM_EDIT_CALLBACK(int3, MSG_Y " " MSG_DAC_PERCENT, &driverPercent[Y_AXIS], 0, 100, dac_driver_commit);
880 885
       MENU_ITEM_EDIT_CALLBACK(int3, MSG_Z " " MSG_DAC_PERCENT, &driverPercent[Z_AXIS], 0, 100, dac_driver_commit);
@@ -961,7 +966,7 @@ void kill_screen(const char* lcd_msg) {
961 966
 
962 967
     static void lcd_preheat_pla_menu() {
963 968
       START_MENU();
964
-      MENU_ITEM(back, MSG_PREPARE);
969
+      MENU_BACK(MSG_PREPARE);
965 970
       #if HOTENDS == 1
966 971
         MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_pla0);
967 972
       #else
@@ -983,7 +988,7 @@ void kill_screen(const char* lcd_msg) {
983 988
 
984 989
     static void lcd_preheat_abs_menu() {
985 990
       START_MENU();
986
-      MENU_ITEM(back, MSG_PREPARE);
991
+      MENU_BACK(MSG_PREPARE);
987 992
       #if HOTENDS == 1
988 993
         MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_abs0);
989 994
       #else
@@ -1210,7 +1215,7 @@ void kill_screen(const char* lcd_msg) {
1210 1215
      */
1211 1216
     static void lcd_level_bed() {
1212 1217
       START_MENU();
1213
-      MENU_ITEM(back, MSG_LEVEL_BED_CANCEL);
1218
+      MENU_BACK(MSG_LEVEL_BED_CANCEL);
1214 1219
       MENU_ITEM(submenu, MSG_LEVEL_BED, _lcd_level_bed_continue);
1215 1220
       END_MENU();
1216 1221
     }
@@ -1229,7 +1234,7 @@ void kill_screen(const char* lcd_msg) {
1229 1234
     //
1230 1235
     // ^ Main
1231 1236
     //
1232
-    MENU_ITEM(back, MSG_MAIN);
1237
+    MENU_BACK(MSG_MAIN);
1233 1238
 
1234 1239
     //
1235 1240
     // Auto Home
@@ -1333,7 +1338,7 @@ void kill_screen(const char* lcd_msg) {
1333 1338
 
1334 1339
     static void lcd_delta_calibrate_menu() {
1335 1340
       START_MENU();
1336
-      MENU_ITEM(back, MSG_MAIN);
1341
+      MENU_BACK(MSG_MAIN);
1337 1342
       MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
1338 1343
       MENU_ITEM(function, MSG_DELTA_CALIBRATE_X, _goto_tower_x);
1339 1344
       MENU_ITEM(function, MSG_DELTA_CALIBRATE_Y, _goto_tower_y);
@@ -1478,7 +1483,7 @@ void kill_screen(const char* lcd_msg) {
1478 1483
 
1479 1484
   static void _lcd_move_menu_axis() {
1480 1485
     START_MENU();
1481
-    MENU_ITEM(back, MSG_MOVE_AXIS);
1486
+    MENU_BACK(MSG_MOVE_AXIS);
1482 1487
 
1483 1488
     if (_MOVE_XYZ_ALLOWED) {
1484 1489
       MENU_ITEM(submenu, MSG_MOVE_X, lcd_move_x);
@@ -1531,7 +1536,7 @@ void kill_screen(const char* lcd_msg) {
1531 1536
 
1532 1537
   static void lcd_move_menu() {
1533 1538
     START_MENU();
1534
-    MENU_ITEM(back, MSG_PREPARE);
1539
+    MENU_BACK(MSG_PREPARE);
1535 1540
 
1536 1541
     if (_MOVE_XYZ_ALLOWED)
1537 1542
       MENU_ITEM(submenu, MSG_MOVE_10MM, lcd_move_menu_10mm);
@@ -1550,7 +1555,7 @@ void kill_screen(const char* lcd_msg) {
1550 1555
 
1551 1556
   static void lcd_control_menu() {
1552 1557
     START_MENU();
1553
-    MENU_ITEM(back, MSG_MAIN);
1558
+    MENU_BACK(MSG_MAIN);
1554 1559
     MENU_ITEM(submenu, MSG_TEMPERATURE, lcd_control_temperature_menu);
1555 1560
     MENU_ITEM(submenu, MSG_MOTION, lcd_control_motion_menu);
1556 1561
     MENU_ITEM(submenu, MSG_VOLUMETRIC, lcd_control_volumetric_menu);
@@ -1663,7 +1668,7 @@ void kill_screen(const char* lcd_msg) {
1663 1668
     //
1664 1669
     // ^ Control
1665 1670
     //
1666
-    MENU_ITEM(back, MSG_CONTROL);
1671
+    MENU_BACK(MSG_CONTROL);
1667 1672
 
1668 1673
     //
1669 1674
     // Nozzle:
@@ -1795,7 +1800,7 @@ void kill_screen(const char* lcd_msg) {
1795 1800
    */
1796 1801
   static void lcd_control_temperature_preheat_pla_settings_menu() {
1797 1802
     START_MENU();
1798
-    MENU_ITEM(back, MSG_TEMPERATURE);
1803
+    MENU_BACK(MSG_TEMPERATURE);
1799 1804
     MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &preheatFanSpeed1, 0, 255);
1800 1805
     #if TEMP_SENSOR_0 != 0
1801 1806
       MENU_ITEM_EDIT(int3, MSG_NOZZLE, &preheatHotendTemp1, HEATER_0_MINTEMP, HEATER_0_MAXTEMP - 15);
@@ -1816,7 +1821,7 @@ void kill_screen(const char* lcd_msg) {
1816 1821
    */
1817 1822
   static void lcd_control_temperature_preheat_abs_settings_menu() {
1818 1823
     START_MENU();
1819
-    MENU_ITEM(back, MSG_TEMPERATURE);
1824
+    MENU_BACK(MSG_TEMPERATURE);
1820 1825
     MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &preheatFanSpeed2, 0, 255);
1821 1826
     #if TEMP_SENSOR_0 != 0
1822 1827
       MENU_ITEM_EDIT(int3, MSG_NOZZLE, &preheatHotendTemp2, HEATER_0_MINTEMP, HEATER_0_MAXTEMP - 15);
@@ -1840,7 +1845,7 @@ void kill_screen(const char* lcd_msg) {
1840 1845
    */
1841 1846
   static void lcd_control_motion_menu() {
1842 1847
     START_MENU();
1843
-    MENU_ITEM(back, MSG_CONTROL);
1848
+    MENU_BACK(MSG_CONTROL);
1844 1849
     #if HAS_BED_PROBE
1845 1850
       MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
1846 1851
     #endif
@@ -1890,7 +1895,7 @@ void kill_screen(const char* lcd_msg) {
1890 1895
    */
1891 1896
   static void lcd_control_volumetric_menu() {
1892 1897
     START_MENU();
1893
-    MENU_ITEM(back, MSG_CONTROL);
1898
+    MENU_BACK(MSG_CONTROL);
1894 1899
 
1895 1900
     MENU_ITEM_EDIT_CALLBACK(bool, MSG_VOLUMETRIC_ENABLED, &volumetric_enabled, calculate_volumetric_multipliers);
1896 1901
 
@@ -1947,7 +1952,7 @@ void kill_screen(const char* lcd_msg) {
1947 1952
 
1948 1953
     static void lcd_control_retract_menu() {
1949 1954
       START_MENU();
1950
-      MENU_ITEM(back, MSG_CONTROL);
1955
+      MENU_BACK(MSG_CONTROL);
1951 1956
       MENU_ITEM_EDIT(bool, MSG_AUTORETRACT, &autoretract_enabled);
1952 1957
       MENU_ITEM_EDIT(float52, MSG_CONTROL_RETRACT, &retract_length, 0, 100);
1953 1958
       #if EXTRUDERS > 1
@@ -1989,7 +1994,7 @@ void kill_screen(const char* lcd_msg) {
1989 1994
       if (lcdDrawUpdate == 0 && LCD_CLICKED == 0) return; // nothing to do (so don't thrash the SD card)
1990 1995
       uint16_t fileCnt = card.getnrfilenames();
1991 1996
       START_MENU();
1992
-      MENU_ITEM(back, MSG_MAIN);
1997
+      MENU_BACK(MSG_MAIN);
1993 1998
       card.getWorkDirName();
1994 1999
       if (card.filename[0] == '/') {
1995 2000
         #if !PIN_EXISTS(SD_DETECT)
@@ -2120,14 +2125,14 @@ void kill_screen(const char* lcd_msg) {
2120 2125
     static void lcd_info_board_menu() {
2121 2126
       if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
2122 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 2131
       #ifdef POWER_SUPPLY
2127 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 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 2136
         #endif
2132 2137
       #endif // POWER_SUPPLY
2133 2138
       END_SCREEN();
@@ -2141,12 +2146,12 @@ void kill_screen(const char* lcd_msg) {
2141 2146
     static void lcd_info_printer_menu() {
2142 2147
       if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
2143 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 2155
       END_SCREEN();
2151 2156
     }
2152 2157
 
@@ -2157,7 +2162,7 @@ void kill_screen(const char* lcd_msg) {
2157 2162
      */
2158 2163
     static void lcd_info_menu() {
2159 2164
       START_MENU();
2160
-      MENU_ITEM(back, MSG_MAIN);
2165
+      MENU_BACK(MSG_MAIN);
2161 2166
       MENU_ITEM(submenu, MSG_INFO_PRINTER_MENU, lcd_info_printer_menu);        // Printer Info >
2162 2167
       MENU_ITEM(submenu, MSG_INFO_BOARD_MENU, lcd_info_board_menu);            // Board Info >
2163 2168
       MENU_ITEM(submenu, MSG_INFO_THERMISTOR_MENU, lcd_info_thermistors_menu); // Thermistors >
@@ -2431,7 +2436,7 @@ void kill_screen(const char* lcd_msg) {
2431 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 2440
   static void menu_action_submenu(screenFunc_t func) { lcd_save_previous_menu(); lcd_goto_screen(func); }
2436 2441
   static void menu_action_gcode(const char* pgcode) { enqueue_and_echo_commands_P(pgcode); }
2437 2442
   static void menu_action_function(screenFunc_t func) { (*func)(); }

+ 1
- 1
Marlin/ultralcd_impl_DOGM.h ファイルの表示

@@ -550,7 +550,7 @@ static void lcd_implementation_status_screen() {
550 550
   }
551 551
 
552 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 554
   #define lcd_implementation_drawmenu_submenu(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0])
555 555
   #define lcd_implementation_drawmenu_gcode(sel, row, pstr, gcode) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')
556 556
   #define lcd_implementation_drawmenu_function(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')

+ 1
- 1
Marlin/ultralcd_impl_HD44780.h ファイルの表示

@@ -911,7 +911,7 @@ static void lcd_implementation_status_screen() {
911 911
 
912 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 915
   #define lcd_implementation_drawmenu_submenu(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0])
916 916
   #define lcd_implementation_drawmenu_gcode(sel, row, pstr, gcode) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')
917 917
   #define lcd_implementation_drawmenu_function(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')

読み込み中…
キャンセル
保存