Browse Source

Fix menu_temp_xx_filament_change menu items

Scott Lahteine 6 years ago
parent
commit
5ead026967
1 changed files with 8 additions and 8 deletions
  1. 8
    8
      Marlin/src/lcd/menu/menu_filament.cpp

+ 8
- 8
Marlin/src/lcd/menu/menu_filament.cpp View File

@@ -38,7 +38,7 @@
38 38
 static AdvancedPauseMode _change_filament_temp_mode; // =ADVANCED_PAUSE_MODE_PAUSE_PRINT
39 39
 static int8_t _change_filament_temp_extruder; // =0
40 40
 
41
-static PGM_P _change_filament_temp_command() {
41
+inline PGM_P _change_filament_temp_command() {
42 42
   switch (_change_filament_temp_mode) {
43 43
     case ADVANCED_PAUSE_MODE_LOAD_FILAMENT:
44 44
       return PSTR("M701 T%d");
@@ -51,15 +51,15 @@ static PGM_P _change_filament_temp_command() {
51 51
   return PSTR(MSG_FILAMENTCHANGE);
52 52
 }
53 53
 
54
-void _change_filament_temp(const uint16_t temperature) {
54
+static void _change_filament_temp(const uint16_t temperature) {
55 55
   char cmd[11];
56 56
   sprintf_P(cmd, _change_filament_temp_command(), _change_filament_temp_extruder);
57 57
   thermalManager.setTargetHotend(temperature, _change_filament_temp_extruder);
58 58
   lcd_enqueue_command(cmd);
59 59
 }
60
-void _menu_change_filament_temp_1() { _change_filament_temp(PREHEAT_1_TEMP_HOTEND); }
61
-void _menu_change_filament_temp_2() { _change_filament_temp(PREHEAT_2_TEMP_HOTEND); }
62
-void _menu_change_filament_temp_custom() { _change_filament_temp(thermalManager.target_temperature[_change_filament_temp_extruder]); }
60
+inline void _lcd_change_filament_temp_1_func()    { _change_filament_temp(PREHEAT_1_TEMP_HOTEND); }
61
+inline void _lcd_change_filament_temp_2_func()    { _change_filament_temp(PREHEAT_2_TEMP_HOTEND); }
62
+inline void _lcd_change_filament_temp_custom_cb() { _change_filament_temp(thermalManager.target_temperature[_change_filament_temp_extruder]); }
63 63
 
64 64
 static PGM_P change_filament_header(const AdvancedPauseMode mode) {
65 65
   switch (mode) {
@@ -78,8 +78,8 @@ void _menu_temp_filament_op(const AdvancedPauseMode mode, const int8_t extruder)
78 78
   START_MENU();
79 79
   if (LCD_HEIGHT >= 4) STATIC_ITEM_P(change_filament_header(mode), true, true);
80 80
   MENU_BACK(MSG_BACK);
81
-  MENU_ITEM(submenu, MSG_PREHEAT_1, _menu_change_filament_temp_1);
82
-  MENU_ITEM(submenu, MSG_PREHEAT_2, _menu_change_filament_temp_2);
81
+  MENU_ITEM(function, MSG_PREHEAT_1, _lcd_change_filament_temp_1_func);
82
+  MENU_ITEM(function, MSG_PREHEAT_2, _lcd_change_filament_temp_2_func);
83 83
   uint16_t max_temp;
84 84
   switch (extruder) {
85 85
     default: max_temp = HEATER_0_MAXTEMP;
@@ -99,7 +99,7 @@ void _menu_temp_filament_op(const AdvancedPauseMode mode, const int8_t extruder)
99 99
       #endif
100 100
     #endif
101 101
   }
102
-  MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_PREHEAT_CUSTOM, &thermalManager.target_temperature[_change_filament_temp_extruder], EXTRUDE_MINTEMP, max_temp - 15, _menu_change_filament_temp_custom);
102
+  MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_PREHEAT_CUSTOM, &thermalManager.target_temperature[_change_filament_temp_extruder], EXTRUDE_MINTEMP, max_temp - 15, _lcd_change_filament_temp_custom_cb);
103 103
   END_MENU();
104 104
 }
105 105
 void menu_temp_e0_filament_change()  { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 0); }

Loading…
Cancel
Save