|
@@ -1,5 +1,5 @@
|
1
|
1
|
#include "ultralcd.h"
|
2
|
|
-#ifdef ULTRA_LCD
|
|
2
|
+#if ENABLED(ULTRA_LCD)
|
3
|
3
|
#include "Marlin.h"
|
4
|
4
|
#include "language.h"
|
5
|
5
|
#include "cardreader.h"
|
|
@@ -20,7 +20,7 @@ int absPreheatHotendTemp;
|
20
|
20
|
int absPreheatHPBTemp;
|
21
|
21
|
int absPreheatFanSpeed;
|
22
|
22
|
|
23
|
|
-#ifdef FILAMENT_LCD_DISPLAY
|
|
23
|
+#if ENABLED(FILAMENT_LCD_DISPLAY)
|
24
|
24
|
millis_t previous_lcd_status_ms = 0;
|
25
|
25
|
#endif
|
26
|
26
|
|
|
@@ -30,7 +30,7 @@ typedef void (*menuFunc_t)();
|
30
|
30
|
uint8_t lcd_status_message_level;
|
31
|
31
|
char lcd_status_message[3*LCD_WIDTH+1] = WELCOME_MSG; // worst case is kana with up to 3*LCD_WIDTH+1
|
32
|
32
|
|
33
|
|
-#ifdef DOGLCD
|
|
33
|
+#if ENABLED(DOGLCD)
|
34
|
34
|
#include "dogm_lcd_implementation.h"
|
35
|
35
|
#else
|
36
|
36
|
#include "ultralcd_implementation_hitachi_HD44780.h"
|
|
@@ -39,7 +39,7 @@ char lcd_status_message[3*LCD_WIDTH+1] = WELCOME_MSG; // worst case is kana with
|
39
|
39
|
// The main status screen
|
40
|
40
|
static void lcd_status_screen();
|
41
|
41
|
|
42
|
|
-#ifdef ULTIPANEL
|
|
42
|
+#if ENABLED(ULTIPANEL)
|
43
|
43
|
|
44
|
44
|
#if HAS_POWER_SWITCH
|
45
|
45
|
extern bool powersupply;
|
|
@@ -55,19 +55,19 @@ static void lcd_status_screen();
|
55
|
55
|
static void lcd_control_temperature_preheat_abs_settings_menu();
|
56
|
56
|
static void lcd_control_motion_menu();
|
57
|
57
|
static void lcd_control_volumetric_menu();
|
58
|
|
- #ifdef HAS_LCD_CONTRAST
|
|
58
|
+ #if ENABLED(HAS_LCD_CONTRAST)
|
59
|
59
|
static void lcd_set_contrast();
|
60
|
60
|
#endif
|
61
|
|
- #ifdef FWRETRACT
|
|
61
|
+ #if ENABLED(FWRETRACT)
|
62
|
62
|
static void lcd_control_retract_menu();
|
63
|
63
|
#endif
|
64
|
64
|
static void lcd_sdcard_menu();
|
65
|
65
|
|
66
|
|
- #ifdef DELTA_CALIBRATION_MENU
|
|
66
|
+ #if ENABLED(DELTA_CALIBRATION_MENU)
|
67
|
67
|
static void lcd_delta_calibrate_menu();
|
68
|
68
|
#endif
|
69
|
69
|
|
70
|
|
- #if defined(MANUAL_BED_LEVELING)
|
|
70
|
+ #if ENABLED(MANUAL_BED_LEVELING)
|
71
|
71
|
#include "mesh_bed_leveling.h"
|
72
|
72
|
static void _lcd_level_bed();
|
73
|
73
|
static void _lcd_level_bed_homing();
|
|
@@ -102,7 +102,7 @@ static void lcd_status_screen();
|
102
|
102
|
|
103
|
103
|
#define ENCODER_FEEDRATE_DEADZONE 10
|
104
|
104
|
|
105
|
|
- #if !defined(LCD_I2C_VIKI)
|
|
105
|
+ #if DISABLED(LCD_I2C_VIKI)
|
106
|
106
|
#ifndef ENCODER_STEPS_PER_MENU_ITEM
|
107
|
107
|
#define ENCODER_STEPS_PER_MENU_ITEM 5
|
108
|
108
|
#endif
|
|
@@ -169,7 +169,7 @@ static void lcd_status_screen();
|
169
|
169
|
_menuItemNr++; \
|
170
|
170
|
} while(0)
|
171
|
171
|
|
172
|
|
- #ifdef ENCODER_RATE_MULTIPLIER
|
|
172
|
+ #if ENABLED(ENCODER_RATE_MULTIPLIER)
|
173
|
173
|
|
174
|
174
|
//#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value
|
175
|
175
|
|
|
@@ -196,7 +196,7 @@ static void lcd_status_screen();
|
196
|
196
|
#define MENU_ITEM_DUMMY() do { _menuItemNr++; } while(0)
|
197
|
197
|
#define MENU_ITEM_EDIT(type, label, args...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label), ## args)
|
198
|
198
|
#define MENU_ITEM_EDIT_CALLBACK(type, label, args...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## args)
|
199
|
|
- #ifdef ENCODER_RATE_MULTIPLIER
|
|
199
|
+ #if ENABLED(ENCODER_RATE_MULTIPLIER)
|
200
|
200
|
#define MENU_MULTIPLIER_ITEM_EDIT(type, label, args...) MENU_MULTIPLIER_ITEM(setting_edit_ ## type, label, PSTR(label), ## args)
|
201
|
201
|
#define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, args...) MENU_MULTIPLIER_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## args)
|
202
|
202
|
#else //!ENCODER_RATE_MULTIPLIER
|
|
@@ -210,11 +210,11 @@ static void lcd_status_screen();
|
210
|
210
|
|
211
|
211
|
/** Used variables to keep track of the menu */
|
212
|
212
|
volatile uint8_t buttons; //the last checked buttons in a bit array.
|
213
|
|
- #ifdef REPRAPWORLD_KEYPAD
|
|
213
|
+ #if ENABLED(REPRAPWORLD_KEYPAD)
|
214
|
214
|
volatile uint8_t buttons_reprapworld_keypad; // to store the keypad shift register values
|
215
|
215
|
#endif
|
216
|
216
|
|
217
|
|
- #ifdef LCD_HAS_SLOW_BUTTONS
|
|
217
|
+ #if ENABLED(LCD_HAS_SLOW_BUTTONS)
|
218
|
218
|
volatile uint8_t slow_buttons; // Bits of the pressed buttons.
|
219
|
219
|
#endif
|
220
|
220
|
uint8_t currentMenuViewOffset; /* scroll offset in the current menu */
|
|
@@ -252,12 +252,12 @@ float raw_Ki, raw_Kd;
|
252
|
252
|
static void lcd_goto_menu(menuFunc_t menu, const bool feedback=false, const uint32_t encoder=0) {
|
253
|
253
|
if (currentMenu != menu) {
|
254
|
254
|
currentMenu = menu;
|
255
|
|
- #ifdef NEWPANEL
|
|
255
|
+ #if ENABLED(NEWPANEL)
|
256
|
256
|
encoderPosition = encoder;
|
257
|
257
|
if (feedback) lcd_quick_feedback();
|
258
|
258
|
#endif
|
259
|
259
|
// For LCD_PROGRESS_BAR re-initialize the custom characters
|
260
|
|
- #ifdef LCD_PROGRESS_BAR
|
|
260
|
+ #if ENABLED(LCD_PROGRESS_BAR)
|
261
|
261
|
lcd_set_custom_characters(menu == lcd_status_screen);
|
262
|
262
|
#endif
|
263
|
263
|
}
|
|
@@ -273,7 +273,7 @@ static void lcd_goto_menu(menuFunc_t menu, const bool feedback=false, const uint
|
273
|
273
|
static void lcd_status_screen() {
|
274
|
274
|
encoderRateMultiplierEnabled = false;
|
275
|
275
|
|
276
|
|
- #ifdef LCD_PROGRESS_BAR
|
|
276
|
+ #if ENABLED(LCD_PROGRESS_BAR)
|
277
|
277
|
millis_t ms = millis();
|
278
|
278
|
#ifndef PROGRESS_MSG_ONCE
|
279
|
279
|
if (ms > progress_bar_ms + PROGRESS_BAR_MSG_TIME + PROGRESS_BAR_BAR_TIME) {
|
|
@@ -305,7 +305,7 @@ static void lcd_status_screen() {
|
305
|
305
|
|
306
|
306
|
lcd_implementation_status_screen();
|
307
|
307
|
|
308
|
|
- #ifdef ULTIPANEL
|
|
308
|
+ #if ENABLED(ULTIPANEL)
|
309
|
309
|
|
310
|
310
|
bool current_click = LCD_CLICKED;
|
311
|
311
|
|
|
@@ -326,16 +326,16 @@ static void lcd_status_screen() {
|
326
|
326
|
if (current_click) {
|
327
|
327
|
lcd_goto_menu(lcd_main_menu, true);
|
328
|
328
|
lcd_implementation_init( // to maybe revive the LCD if static electricity killed it.
|
329
|
|
- #ifdef LCD_PROGRESS_BAR
|
|
329
|
+ #if ENABLED(LCD_PROGRESS_BAR)
|
330
|
330
|
currentMenu == lcd_status_screen
|
331
|
331
|
#endif
|
332
|
332
|
);
|
333
|
|
- #ifdef FILAMENT_LCD_DISPLAY
|
|
333
|
+ #if ENABLED(FILAMENT_LCD_DISPLAY)
|
334
|
334
|
previous_lcd_status_ms = millis(); // get status message to show up for a while
|
335
|
335
|
#endif
|
336
|
336
|
}
|
337
|
337
|
|
338
|
|
- #ifdef ULTIPANEL_FEEDMULTIPLY
|
|
338
|
+ #if ENABLED(ULTIPANEL_FEEDMULTIPLY)
|
339
|
339
|
// Dead zone at 100% feedrate
|
340
|
340
|
if ((feedrate_multiplier < 100 && (feedrate_multiplier + int(encoderPosition)) > 100) ||
|
341
|
341
|
(feedrate_multiplier > 100 && (feedrate_multiplier + int(encoderPosition)) < 100)) {
|
|
@@ -363,7 +363,7 @@ static void lcd_status_screen() {
|
363
|
363
|
#endif //ULTIPANEL
|
364
|
364
|
}
|
365
|
365
|
|
366
|
|
-#ifdef ULTIPANEL
|
|
366
|
+#if ENABLED(ULTIPANEL)
|
367
|
367
|
|
368
|
368
|
static void lcd_return_to_status() { lcd_goto_menu(lcd_status_screen); }
|
369
|
369
|
|
|
@@ -394,13 +394,13 @@ static void lcd_main_menu() {
|
394
|
394
|
}
|
395
|
395
|
else {
|
396
|
396
|
MENU_ITEM(submenu, MSG_PREPARE, lcd_prepare_menu);
|
397
|
|
- #ifdef DELTA_CALIBRATION_MENU
|
|
397
|
+ #if ENABLED(DELTA_CALIBRATION_MENU)
|
398
|
398
|
MENU_ITEM(submenu, MSG_DELTA_CALIBRATE, lcd_delta_calibrate_menu);
|
399
|
399
|
#endif
|
400
|
400
|
}
|
401
|
401
|
MENU_ITEM(submenu, MSG_CONTROL, lcd_control_menu);
|
402
|
402
|
|
403
|
|
- #ifdef SDSUPPORT
|
|
403
|
+ #if ENABLED(SDSUPPORT)
|
404
|
404
|
if (card.cardOK) {
|
405
|
405
|
if (card.isFileOpen()) {
|
406
|
406
|
if (card.sdprinting)
|
|
@@ -427,7 +427,7 @@ static void lcd_main_menu() {
|
427
|
427
|
END_MENU();
|
428
|
428
|
}
|
429
|
429
|
|
430
|
|
-#if defined(SDSUPPORT) && defined(MENU_ADDAUTOSTART)
|
|
430
|
+#if ENABLED(SDSUPPORT) && ENABLED(MENU_ADDAUTOSTART)
|
431
|
431
|
static void lcd_autostart_sd() {
|
432
|
432
|
card.autostart_index = 0;
|
433
|
433
|
card.setroot();
|
|
@@ -445,7 +445,7 @@ void lcd_set_home_offsets() {
|
445
|
445
|
}
|
446
|
446
|
|
447
|
447
|
|
448
|
|
-#ifdef BABYSTEPPING
|
|
448
|
+#if ENABLED(BABYSTEPPING)
|
449
|
449
|
|
450
|
450
|
static void _lcd_babystep(int axis, const char *msg) {
|
451
|
451
|
if (encoderPosition != 0) {
|
|
@@ -500,14 +500,14 @@ static void lcd_tune_menu() {
|
500
|
500
|
MENU_ITEM_EDIT(int3, MSG_FLOW MSG_N3, &extruder_multiplier[3], 10, 999);
|
501
|
501
|
#endif
|
502
|
502
|
|
503
|
|
- #ifdef BABYSTEPPING
|
504
|
|
- #ifdef BABYSTEP_XY
|
|
503
|
+ #if ENABLED(BABYSTEPPING)
|
|
504
|
+ #if ENABLED(BABYSTEP_XY)
|
505
|
505
|
MENU_ITEM(submenu, MSG_BABYSTEP_X, lcd_babystep_x);
|
506
|
506
|
MENU_ITEM(submenu, MSG_BABYSTEP_Y, lcd_babystep_y);
|
507
|
507
|
#endif //BABYSTEP_XY
|
508
|
508
|
MENU_ITEM(submenu, MSG_BABYSTEP_Z, lcd_babystep_z);
|
509
|
509
|
#endif
|
510
|
|
- #ifdef FILAMENTCHANGEENABLE
|
|
510
|
+ #if ENABLED(FILAMENTCHANGEENABLE)
|
511
|
511
|
MENU_ITEM(gcode, MSG_FILAMENTCHANGE, PSTR("M600"));
|
512
|
512
|
#endif
|
513
|
513
|
END_MENU();
|
|
@@ -638,10 +638,10 @@ static void lcd_prepare_menu() {
|
638
|
638
|
//
|
639
|
639
|
// Level Bed
|
640
|
640
|
//
|
641
|
|
- #ifdef ENABLE_AUTO_BED_LEVELING
|
|
641
|
+ #if ENABLED(ENABLE_AUTO_BED_LEVELING)
|
642
|
642
|
if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS])
|
643
|
643
|
MENU_ITEM(gcode, MSG_LEVEL_BED, PSTR("G29"));
|
644
|
|
- #elif defined(MANUAL_BED_LEVELING)
|
|
644
|
+ #elif ENABLED(MANUAL_BED_LEVELING)
|
645
|
645
|
MENU_ITEM(submenu, MSG_LEVEL_BED, lcd_level_bed);
|
646
|
646
|
#endif
|
647
|
647
|
|
|
@@ -687,14 +687,14 @@ static void lcd_prepare_menu() {
|
687
|
687
|
//
|
688
|
688
|
// Autostart
|
689
|
689
|
//
|
690
|
|
- #if defined(SDSUPPORT) && defined(MENU_ADDAUTOSTART)
|
|
690
|
+ #if ENABLED(SDSUPPORT) && ENABLED(MENU_ADDAUTOSTART)
|
691
|
691
|
MENU_ITEM(function, MSG_AUTOSTART, lcd_autostart_sd);
|
692
|
692
|
#endif
|
693
|
693
|
|
694
|
694
|
END_MENU();
|
695
|
695
|
}
|
696
|
696
|
|
697
|
|
-#ifdef DELTA_CALIBRATION_MENU
|
|
697
|
+#if ENABLED(DELTA_CALIBRATION_MENU)
|
698
|
698
|
|
699
|
699
|
static void lcd_delta_calibrate_menu() {
|
700
|
700
|
START_MENU();
|
|
@@ -710,7 +710,7 @@ static void lcd_prepare_menu() {
|
710
|
710
|
#endif // DELTA_CALIBRATION_MENU
|
711
|
711
|
|
712
|
712
|
inline void line_to_current(AxisEnum axis) {
|
713
|
|
- #ifdef DELTA
|
|
713
|
+ #if ENABLED(DELTA)
|
714
|
714
|
calculate_delta(current_position);
|
715
|
715
|
plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], manual_feedrate[axis]/60, active_extruder);
|
716
|
716
|
#else
|
|
@@ -814,14 +814,14 @@ static void lcd_control_menu() {
|
814
|
814
|
MENU_ITEM(submenu, MSG_MOTION, lcd_control_motion_menu);
|
815
|
815
|
MENU_ITEM(submenu, MSG_VOLUMETRIC, lcd_control_volumetric_menu);
|
816
|
816
|
|
817
|
|
- #ifdef HAS_LCD_CONTRAST
|
|
817
|
+ #if ENABLED(HAS_LCD_CONTRAST)
|
818
|
818
|
//MENU_ITEM_EDIT(int3, MSG_CONTRAST, &lcd_contrast, 0, 63);
|
819
|
819
|
MENU_ITEM(submenu, MSG_CONTRAST, lcd_set_contrast);
|
820
|
820
|
#endif
|
821
|
|
- #ifdef FWRETRACT
|
|
821
|
+ #if ENABLED(FWRETRACT)
|
822
|
822
|
MENU_ITEM(submenu, MSG_RETRACT, lcd_control_retract_menu);
|
823
|
823
|
#endif
|
824
|
|
- #ifdef EEPROM_SETTINGS
|
|
824
|
+ #if ENABLED(EEPROM_SETTINGS)
|
825
|
825
|
MENU_ITEM(function, MSG_STORE_EPROM, Config_StoreSettings);
|
826
|
826
|
MENU_ITEM(function, MSG_LOAD_EPROM, Config_RetrieveSettings);
|
827
|
827
|
#endif
|
|
@@ -835,7 +835,7 @@ static void lcd_control_menu() {
|
835
|
835
|
*
|
836
|
836
|
*/
|
837
|
837
|
|
838
|
|
-#ifdef PIDTEMP
|
|
838
|
+#if ENABLED(PIDTEMP)
|
839
|
839
|
|
840
|
840
|
// Helpers for editing PID Ki & Kd values
|
841
|
841
|
// grab the PID value out of the temp variable; scale it; then update the PID driver
|
|
@@ -849,7 +849,7 @@ static void lcd_control_menu() {
|
849
|
849
|
}
|
850
|
850
|
void copy_and_scalePID_i_E1() { copy_and_scalePID_i(0); }
|
851
|
851
|
void copy_and_scalePID_d_E1() { copy_and_scalePID_d(0); }
|
852
|
|
- #ifdef PID_PARAMS_PER_EXTRUDER
|
|
852
|
+ #if ENABLED(PID_PARAMS_PER_EXTRUDER)
|
853
|
853
|
#if EXTRUDERS > 1
|
854
|
854
|
void copy_and_scalePID_i_E2() { copy_and_scalePID_i(1); }
|
855
|
855
|
void copy_and_scalePID_d_E2() { copy_and_scalePID_d(1); }
|
|
@@ -916,7 +916,7 @@ static void lcd_control_temperature_menu() {
|
916
|
916
|
//
|
917
|
917
|
// Autotemp, Min, Max, Fact
|
918
|
918
|
//
|
919
|
|
- #if defined(AUTOTEMP) && (TEMP_SENSOR_0 != 0)
|
|
919
|
+ #if ENABLED(AUTOTEMP) && (TEMP_SENSOR_0 != 0)
|
920
|
920
|
MENU_ITEM_EDIT(bool, MSG_AUTOTEMP, &autotemp_enabled);
|
921
|
921
|
MENU_ITEM_EDIT(float3, MSG_MIN, &autotemp_min, 0, HEATER_0_MAXTEMP - 15);
|
922
|
922
|
MENU_ITEM_EDIT(float3, MSG_MAX, &autotemp_max, 0, HEATER_0_MAXTEMP - 15);
|
|
@@ -926,7 +926,7 @@ static void lcd_control_temperature_menu() {
|
926
|
926
|
//
|
927
|
927
|
// PID-P, PID-I, PID-D, PID-C
|
928
|
928
|
//
|
929
|
|
- #ifdef PIDTEMP
|
|
929
|
+ #if ENABLED(PIDTEMP)
|
930
|
930
|
// set up temp variables - undo the default scaling
|
931
|
931
|
raw_Ki = unscalePID_i(PID_PARAM(Ki,0));
|
932
|
932
|
raw_Kd = unscalePID_d(PID_PARAM(Kd,0));
|
|
@@ -934,10 +934,10 @@ static void lcd_control_temperature_menu() {
|
934
|
934
|
// i is typically a small value so allows values below 1
|
935
|
935
|
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I, &raw_Ki, 0.01, 9990, copy_and_scalePID_i_E1);
|
936
|
936
|
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D, &raw_Kd, 1, 9990, copy_and_scalePID_d_E1);
|
937
|
|
- #ifdef PID_ADD_EXTRUSION_RATE
|
|
937
|
+ #if ENABLED(PID_ADD_EXTRUSION_RATE)
|
938
|
938
|
MENU_ITEM_EDIT(float3, MSG_PID_C, &PID_PARAM(Kc,0), 1, 9990);
|
939
|
939
|
#endif//PID_ADD_EXTRUSION_RATE
|
940
|
|
- #ifdef PID_PARAMS_PER_EXTRUDER
|
|
940
|
+ #if ENABLED(PID_PARAMS_PER_EXTRUDER)
|
941
|
941
|
#if EXTRUDERS > 1
|
942
|
942
|
// set up temp variables - undo the default scaling
|
943
|
943
|
raw_Ki = unscalePID_i(PID_PARAM(Ki,1));
|
|
@@ -946,7 +946,7 @@ static void lcd_control_temperature_menu() {
|
946
|
946
|
// i is typically a small value so allows values below 1
|
947
|
947
|
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I MSG_E2, &raw_Ki, 0.01, 9990, copy_and_scalePID_i_E2);
|
948
|
948
|
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D MSG_E2, &raw_Kd, 1, 9990, copy_and_scalePID_d_E2);
|
949
|
|
- #ifdef PID_ADD_EXTRUSION_RATE
|
|
949
|
+ #if ENABLED(PID_ADD_EXTRUSION_RATE)
|
950
|
950
|
MENU_ITEM_EDIT(float3, MSG_PID_C MSG_E2, &PID_PARAM(Kc,1), 1, 9990);
|
951
|
951
|
#endif//PID_ADD_EXTRUSION_RATE
|
952
|
952
|
|
|
@@ -958,7 +958,7 @@ static void lcd_control_temperature_menu() {
|
958
|
958
|
// i is typically a small value so allows values below 1
|
959
|
959
|
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I MSG_E3, &raw_Ki, 0.01, 9990, copy_and_scalePID_i_E3);
|
960
|
960
|
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D MSG_E3, &raw_Kd, 1, 9990, copy_and_scalePID_d_E3);
|
961
|
|
- #ifdef PID_ADD_EXTRUSION_RATE
|
|
961
|
+ #if ENABLED(PID_ADD_EXTRUSION_RATE)
|
962
|
962
|
MENU_ITEM_EDIT(float3, MSG_PID_C MSG_E3, &PID_PARAM(Kc,2), 1, 9990);
|
963
|
963
|
#endif//PID_ADD_EXTRUSION_RATE
|
964
|
964
|
|
|
@@ -970,7 +970,7 @@ static void lcd_control_temperature_menu() {
|
970
|
970
|
// i is typically a small value so allows values below 1
|
971
|
971
|
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I MSG_E4, &raw_Ki, 0.01, 9990, copy_and_scalePID_i_E4);
|
972
|
972
|
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D MSG_E4, &raw_Kd, 1, 9990, copy_and_scalePID_d_E4);
|
973
|
|
- #ifdef PID_ADD_EXTRUSION_RATE
|
|
973
|
+ #if ENABLED(PID_ADD_EXTRUSION_RATE)
|
974
|
974
|
MENU_ITEM_EDIT(float3, MSG_PID_C MSG_E4, &PID_PARAM(Kc,3), 1, 9990);
|
975
|
975
|
#endif//PID_ADD_EXTRUSION_RATE
|
976
|
976
|
#endif//EXTRUDERS > 3
|
|
@@ -1006,7 +1006,7 @@ static void lcd_control_temperature_preheat_pla_settings_menu() {
|
1006
|
1006
|
#if TEMP_SENSOR_BED != 0
|
1007
|
1007
|
MENU_ITEM_EDIT(int3, MSG_BED, &plaPreheatHPBTemp, BED_MINTEMP, BED_MAXTEMP - 15);
|
1008
|
1008
|
#endif
|
1009
|
|
- #ifdef EEPROM_SETTINGS
|
|
1009
|
+ #if ENABLED(EEPROM_SETTINGS)
|
1010
|
1010
|
MENU_ITEM(function, MSG_STORE_EPROM, Config_StoreSettings);
|
1011
|
1011
|
#endif
|
1012
|
1012
|
END_MENU();
|
|
@@ -1027,7 +1027,7 @@ static void lcd_control_temperature_preheat_abs_settings_menu() {
|
1027
|
1027
|
#if TEMP_SENSOR_BED != 0
|
1028
|
1028
|
MENU_ITEM_EDIT(int3, MSG_BED, &absPreheatHPBTemp, BED_MINTEMP, BED_MAXTEMP - 15);
|
1029
|
1029
|
#endif
|
1030
|
|
- #ifdef EEPROM_SETTINGS
|
|
1030
|
+ #if ENABLED(EEPROM_SETTINGS)
|
1031
|
1031
|
MENU_ITEM(function, MSG_STORE_EPROM, Config_StoreSettings);
|
1032
|
1032
|
#endif
|
1033
|
1033
|
END_MENU();
|
|
@@ -1041,7 +1041,7 @@ static void lcd_control_temperature_preheat_abs_settings_menu() {
|
1041
|
1041
|
static void lcd_control_motion_menu() {
|
1042
|
1042
|
START_MENU();
|
1043
|
1043
|
MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
|
1044
|
|
- #ifdef ENABLE_AUTO_BED_LEVELING
|
|
1044
|
+ #if ENABLED(ENABLE_AUTO_BED_LEVELING)
|
1045
|
1045
|
MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
|
1046
|
1046
|
#endif
|
1047
|
1047
|
MENU_ITEM_EDIT(float5, MSG_ACC, &acceleration, 10, 99000);
|
|
@@ -1064,10 +1064,10 @@ static void lcd_control_motion_menu() {
|
1064
|
1064
|
MENU_ITEM_EDIT(float52, MSG_YSTEPS, &axis_steps_per_unit[Y_AXIS], 5, 9999);
|
1065
|
1065
|
MENU_ITEM_EDIT(float51, MSG_ZSTEPS, &axis_steps_per_unit[Z_AXIS], 5, 9999);
|
1066
|
1066
|
MENU_ITEM_EDIT(float51, MSG_ESTEPS, &axis_steps_per_unit[E_AXIS], 5, 9999);
|
1067
|
|
- #ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
|
|
1067
|
+ #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
|
1068
|
1068
|
MENU_ITEM_EDIT(bool, MSG_ENDSTOP_ABORT, &abort_on_endstop_hit);
|
1069
|
1069
|
#endif
|
1070
|
|
- #ifdef SCARA
|
|
1070
|
+ #if ENABLED(SCARA)
|
1071
|
1071
|
MENU_ITEM_EDIT(float74, MSG_XSCALE, &axis_scaling[X_AXIS],0.5,2);
|
1072
|
1072
|
MENU_ITEM_EDIT(float74, MSG_YSCALE, &axis_scaling[Y_AXIS],0.5,2);
|
1073
|
1073
|
#endif
|
|
@@ -1106,10 +1106,10 @@ static void lcd_control_volumetric_menu() {
|
1106
|
1106
|
* "Control" > "Contrast" submenu
|
1107
|
1107
|
*
|
1108
|
1108
|
*/
|
1109
|
|
-#ifdef HAS_LCD_CONTRAST
|
|
1109
|
+#if ENABLED(HAS_LCD_CONTRAST)
|
1110
|
1110
|
static void lcd_set_contrast() {
|
1111
|
1111
|
if (encoderPosition != 0) {
|
1112
|
|
- #ifdef U8GLIB_LM6059_AF
|
|
1112
|
+ #if ENABLED(U8GLIB_LM6059_AF)
|
1113
|
1113
|
lcd_contrast += encoderPosition;
|
1114
|
1114
|
lcd_contrast &= 0xFF;
|
1115
|
1115
|
#else
|
|
@@ -1121,7 +1121,7 @@ static void lcd_control_volumetric_menu() {
|
1121
|
1121
|
u8g.setContrast(lcd_contrast);
|
1122
|
1122
|
}
|
1123
|
1123
|
if (lcdDrawUpdate) {
|
1124
|
|
- #ifdef U8GLIB_LM6059_AF
|
|
1124
|
+ #if ENABLED(U8GLIB_LM6059_AF)
|
1125
|
1125
|
lcd_implementation_drawedit(PSTR(MSG_CONTRAST), itostr3(lcd_contrast));
|
1126
|
1126
|
#else
|
1127
|
1127
|
lcd_implementation_drawedit(PSTR(MSG_CONTRAST), itostr2(lcd_contrast));
|
|
@@ -1136,7 +1136,7 @@ static void lcd_control_volumetric_menu() {
|
1136
|
1136
|
* "Control" > "Retract" submenu
|
1137
|
1137
|
*
|
1138
|
1138
|
*/
|
1139
|
|
-#ifdef FWRETRACT
|
|
1139
|
+#if ENABLED(FWRETRACT)
|
1140
|
1140
|
static void lcd_control_retract_menu() {
|
1141
|
1141
|
START_MENU();
|
1142
|
1142
|
MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
|
|
@@ -1191,7 +1191,7 @@ void lcd_sdcard_menu() {
|
1191
|
1191
|
for (uint16_t i = 0; i < fileCnt; i++) {
|
1192
|
1192
|
if (_menuItemNr == _lineNr) {
|
1193
|
1193
|
card.getfilename(
|
1194
|
|
- #ifdef SDCARD_RATHERRECENTFIRST
|
|
1194
|
+ #if ENABLED(SDCARD_RATHERRECENTFIRST)
|
1195
|
1195
|
fileCnt-1 -
|
1196
|
1196
|
#endif
|
1197
|
1197
|
i
|
|
@@ -1264,7 +1264,7 @@ menu_edit_type(unsigned long, long5, ftostr5, 0.01)
|
1264
|
1264
|
* Handlers for RepRap World Keypad input
|
1265
|
1265
|
*
|
1266
|
1266
|
*/
|
1267
|
|
-#ifdef REPRAPWORLD_KEYPAD
|
|
1267
|
+#if ENABLED(REPRAPWORLD_KEYPAD)
|
1268
|
1268
|
static void reprapworld_keypad_move_z_up() {
|
1269
|
1269
|
encoderPosition = 1;
|
1270
|
1270
|
move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
|
|
@@ -1307,7 +1307,7 @@ menu_edit_type(unsigned long, long5, ftostr5, 0.01)
|
1307
|
1307
|
*
|
1308
|
1308
|
*/
|
1309
|
1309
|
|
1310
|
|
-#ifdef LCD_USE_I2C_BUZZER
|
|
1310
|
+#if ENABLED(LCD_USE_I2C_BUZZER)
|
1311
|
1311
|
void lcd_buzz(long duration, uint16_t freq) { // called from buzz() in Marlin_main.cpp where lcd is unknown
|
1312
|
1312
|
lcd.buzz(duration, freq);
|
1313
|
1313
|
}
|
|
@@ -1317,7 +1317,7 @@ void lcd_quick_feedback() {
|
1317
|
1317
|
lcdDrawUpdate = 2;
|
1318
|
1318
|
next_button_update_ms = millis() + 500;
|
1319
|
1319
|
|
1320
|
|
- #ifdef LCD_USE_I2C_BUZZER
|
|
1320
|
+ #if ENABLED(LCD_USE_I2C_BUZZER)
|
1321
|
1321
|
#ifndef LCD_FEEDBACK_FREQUENCY_HZ
|
1322
|
1322
|
#define LCD_FEEDBACK_FREQUENCY_HZ 100
|
1323
|
1323
|
#endif
|
|
@@ -1375,7 +1375,7 @@ static void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr,
|
1375
|
1375
|
void lcd_init() {
|
1376
|
1376
|
lcd_implementation_init();
|
1377
|
1377
|
|
1378
|
|
- #ifdef NEWPANEL
|
|
1378
|
+ #if ENABLED(NEWPANEL)
|
1379
|
1379
|
|
1380
|
1380
|
SET_INPUT(BTN_EN1);
|
1381
|
1381
|
SET_INPUT(BTN_EN2);
|
|
@@ -1385,7 +1385,7 @@ void lcd_init() {
|
1385
|
1385
|
SET_INPUT(BTN_ENC);
|
1386
|
1386
|
WRITE(BTN_ENC,HIGH);
|
1387
|
1387
|
#endif
|
1388
|
|
- #ifdef REPRAPWORLD_KEYPAD
|
|
1388
|
+ #if ENABLED(REPRAPWORLD_KEYPAD)
|
1389
|
1389
|
pinMode(SHIFT_CLK,OUTPUT);
|
1390
|
1390
|
pinMode(SHIFT_LD,OUTPUT);
|
1391
|
1391
|
pinMode(SHIFT_OUT,INPUT);
|
|
@@ -1393,7 +1393,7 @@ void lcd_init() {
|
1393
|
1393
|
WRITE(SHIFT_LD,HIGH);
|
1394
|
1394
|
#endif
|
1395
|
1395
|
#else // Not NEWPANEL
|
1396
|
|
- #ifdef SR_LCD_2W_NL // Non latching 2 wire shift register
|
|
1396
|
+ #if ENABLED(SR_LCD_2W_NL) // Non latching 2 wire shift register
|
1397
|
1397
|
pinMode (SR_DATA_PIN, OUTPUT);
|
1398
|
1398
|
pinMode (SR_CLK_PIN, OUTPUT);
|
1399
|
1399
|
#elif defined(SHIFT_CLK)
|
|
@@ -1407,19 +1407,19 @@ void lcd_init() {
|
1407
|
1407
|
#endif // SR_LCD_2W_NL
|
1408
|
1408
|
#endif//!NEWPANEL
|
1409
|
1409
|
|
1410
|
|
- #if defined(SDSUPPORT) && defined(SDCARDDETECT) && (SDCARDDETECT > 0)
|
|
1410
|
+ #if ENABLED(SDSUPPORT) && defined(SDCARDDETECT) && (SDCARDDETECT > 0)
|
1411
|
1411
|
pinMode(SDCARDDETECT, INPUT);
|
1412
|
1412
|
WRITE(SDCARDDETECT, HIGH);
|
1413
|
1413
|
lcd_oldcardstatus = IS_SD_INSERTED;
|
1414
|
1414
|
#endif //(SDCARDDETECT > 0)
|
1415
|
1415
|
|
1416
|
|
- #ifdef LCD_HAS_SLOW_BUTTONS
|
|
1416
|
+ #if ENABLED(LCD_HAS_SLOW_BUTTONS)
|
1417
|
1417
|
slow_buttons = 0;
|
1418
|
1418
|
#endif
|
1419
|
1419
|
|
1420
|
1420
|
lcd_buttons_update();
|
1421
|
1421
|
|
1422
|
|
- #ifdef ULTIPANEL
|
|
1422
|
+ #if ENABLED(ULTIPANEL)
|
1423
|
1423
|
encoderDiff = 0;
|
1424
|
1424
|
#endif
|
1425
|
1425
|
}
|
|
@@ -1456,11 +1456,11 @@ int lcd_strlen_P(const char *s) {
|
1456
|
1456
|
* Warning: This function is called from interrupt context!
|
1457
|
1457
|
*/
|
1458
|
1458
|
void lcd_update() {
|
1459
|
|
- #ifdef ULTIPANEL
|
|
1459
|
+ #if ENABLED(ULTIPANEL)
|
1460
|
1460
|
static millis_t return_to_status_ms = 0;
|
1461
|
1461
|
#endif
|
1462
|
1462
|
|
1463
|
|
- #ifdef LCD_HAS_SLOW_BUTTONS
|
|
1463
|
+ #if ENABLED(LCD_HAS_SLOW_BUTTONS)
|
1464
|
1464
|
slow_buttons = lcd_implementation_read_slow_buttons(); // buttons which take too long to read in interrupt context
|
1465
|
1465
|
#endif
|
1466
|
1466
|
|
|
@@ -1471,7 +1471,7 @@ void lcd_update() {
|
1471
|
1471
|
lcdDrawUpdate = 2;
|
1472
|
1472
|
lcd_oldcardstatus = IS_SD_INSERTED;
|
1473
|
1473
|
lcd_implementation_init( // to maybe revive the LCD if static electricity killed it.
|
1474
|
|
- #ifdef LCD_PROGRESS_BAR
|
|
1474
|
+ #if ENABLED(LCD_PROGRESS_BAR)
|
1475
|
1475
|
currentMenu == lcd_status_screen
|
1476
|
1476
|
#endif
|
1477
|
1477
|
);
|
|
@@ -1490,9 +1490,9 @@ void lcd_update() {
|
1490
|
1490
|
millis_t ms = millis();
|
1491
|
1491
|
if (ms > next_lcd_update_ms) {
|
1492
|
1492
|
|
1493
|
|
- #ifdef ULTIPANEL
|
|
1493
|
+ #if ENABLED(ULTIPANEL)
|
1494
|
1494
|
|
1495
|
|
- #ifdef REPRAPWORLD_KEYPAD
|
|
1495
|
+ #if ENABLED(REPRAPWORLD_KEYPAD)
|
1496
|
1496
|
if (REPRAPWORLD_KEYPAD_MOVE_Z_UP) reprapworld_keypad_move_z_up();
|
1497
|
1497
|
if (REPRAPWORLD_KEYPAD_MOVE_Z_DOWN) reprapworld_keypad_move_z_down();
|
1498
|
1498
|
if (REPRAPWORLD_KEYPAD_MOVE_X_LEFT) reprapworld_keypad_move_x_left();
|
|
@@ -1507,7 +1507,7 @@ void lcd_update() {
|
1507
|
1507
|
if (encoderPastThreshold) {
|
1508
|
1508
|
int32_t encoderMultiplier = 1;
|
1509
|
1509
|
|
1510
|
|
- #ifdef ENCODER_RATE_MULTIPLIER
|
|
1510
|
+ #if ENABLED(ENCODER_RATE_MULTIPLIER)
|
1511
|
1511
|
|
1512
|
1512
|
if (encoderRateMultiplierEnabled) {
|
1513
|
1513
|
int32_t encoderMovementSteps = abs(encoderDiff) / ENCODER_PULSES_PER_STEP;
|
|
@@ -1520,7 +1520,7 @@ void lcd_update() {
|
1520
|
1520
|
if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) encoderMultiplier = 100;
|
1521
|
1521
|
else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC) encoderMultiplier = 10;
|
1522
|
1522
|
|
1523
|
|
- #ifdef ENCODER_RATE_MULTIPLIER_DEBUG
|
|
1523
|
+ #if ENABLED(ENCODER_RATE_MULTIPLIER_DEBUG)
|
1524
|
1524
|
SERIAL_ECHO_START;
|
1525
|
1525
|
SERIAL_ECHO("Enc Step Rate: ");
|
1526
|
1526
|
SERIAL_ECHO(encoderStepRate);
|
|
@@ -1554,7 +1554,7 @@ void lcd_update() {
|
1554
|
1554
|
lcd_status_update_delay--;
|
1555
|
1555
|
}
|
1556
|
1556
|
}
|
1557
|
|
- #ifdef DOGLCD // Changes due to different driver architecture of the DOGM display
|
|
1557
|
+ #if ENABLED(DOGLCD) // Changes due to different driver architecture of the DOGM display
|
1558
|
1558
|
if (lcdDrawUpdate) {
|
1559
|
1559
|
blink++; // Variable for fan animation and alive dot
|
1560
|
1560
|
u8g.firstPage();
|
|
@@ -1571,15 +1571,15 @@ void lcd_update() {
|
1571
|
1571
|
(*currentMenu)();
|
1572
|
1572
|
#endif
|
1573
|
1573
|
|
1574
|
|
- #ifdef LCD_HAS_STATUS_INDICATORS
|
|
1574
|
+ #if ENABLED(LCD_HAS_STATUS_INDICATORS)
|
1575
|
1575
|
lcd_implementation_update_indicators();
|
1576
|
1576
|
#endif
|
1577
|
1577
|
|
1578
|
|
- #ifdef ULTIPANEL
|
|
1578
|
+ #if ENABLED(ULTIPANEL)
|
1579
|
1579
|
|
1580
|
1580
|
// Return to Status Screen after a timeout
|
1581
|
1581
|
if (currentMenu != lcd_status_screen &&
|
1582
|
|
- #ifdef MANUAL_BED_LEVELING
|
|
1582
|
+ #if ENABLED(MANUAL_BED_LEVELING)
|
1583
|
1583
|
currentMenu != _lcd_level_bed &&
|
1584
|
1584
|
currentMenu != _lcd_level_bed_homing &&
|
1585
|
1585
|
#endif
|
|
@@ -1603,7 +1603,7 @@ void lcd_ignore_click(bool b) {
|
1603
|
1603
|
}
|
1604
|
1604
|
|
1605
|
1605
|
void lcd_finishstatus(bool persist=false) {
|
1606
|
|
- #ifdef LCD_PROGRESS_BAR
|
|
1606
|
+ #if ENABLED(LCD_PROGRESS_BAR)
|
1607
|
1607
|
progress_bar_ms = millis();
|
1608
|
1608
|
#if PROGRESS_MSG_EXPIRE > 0
|
1609
|
1609
|
expire_status_ms = persist ? 0 : progress_bar_ms + PROGRESS_MSG_EXPIRE;
|
|
@@ -1611,12 +1611,12 @@ void lcd_finishstatus(bool persist=false) {
|
1611
|
1611
|
#endif
|
1612
|
1612
|
lcdDrawUpdate = 2;
|
1613
|
1613
|
|
1614
|
|
- #ifdef FILAMENT_LCD_DISPLAY
|
|
1614
|
+ #if ENABLED(FILAMENT_LCD_DISPLAY)
|
1615
|
1615
|
previous_lcd_status_ms = millis(); //get status message to show up for a while
|
1616
|
1616
|
#endif
|
1617
|
1617
|
}
|
1618
|
1618
|
|
1619
|
|
-#if defined(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0
|
|
1619
|
+#if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0
|
1620
|
1620
|
void dontExpireStatus() { expire_status_ms = 0; }
|
1621
|
1621
|
#endif
|
1622
|
1622
|
|
|
@@ -1650,21 +1650,21 @@ void lcd_setstatuspgm(const char* message, uint8_t level) {
|
1650
|
1650
|
|
1651
|
1651
|
void lcd_setalertstatuspgm(const char* message) {
|
1652
|
1652
|
lcd_setstatuspgm(message, 1);
|
1653
|
|
- #ifdef ULTIPANEL
|
|
1653
|
+ #if ENABLED(ULTIPANEL)
|
1654
|
1654
|
lcd_return_to_status();
|
1655
|
1655
|
#endif
|
1656
|
1656
|
}
|
1657
|
1657
|
|
1658
|
1658
|
void lcd_reset_alert_level() { lcd_status_message_level = 0; }
|
1659
|
1659
|
|
1660
|
|
-#ifdef HAS_LCD_CONTRAST
|
|
1660
|
+#if ENABLED(HAS_LCD_CONTRAST)
|
1661
|
1661
|
void lcd_setcontrast(uint8_t value) {
|
1662
|
1662
|
lcd_contrast = value & 0x3F;
|
1663
|
1663
|
u8g.setContrast(lcd_contrast);
|
1664
|
1664
|
}
|
1665
|
1665
|
#endif
|
1666
|
1666
|
|
1667
|
|
-#ifdef ULTIPANEL
|
|
1667
|
+#if ENABLED(ULTIPANEL)
|
1668
|
1668
|
|
1669
|
1669
|
/**
|
1670
|
1670
|
* Setup Rotary Encoder Bit Values (for two pin encoders to indicate movement)
|
|
@@ -1683,7 +1683,7 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
|
1683
|
1683
|
* Warning: This function is called from interrupt context!
|
1684
|
1684
|
*/
|
1685
|
1685
|
void lcd_buttons_update() {
|
1686
|
|
- #ifdef NEWPANEL
|
|
1686
|
+ #if ENABLED(NEWPANEL)
|
1687
|
1687
|
uint8_t newbutton = 0;
|
1688
|
1688
|
if (READ(BTN_EN1) == 0) newbutton |= EN_A;
|
1689
|
1689
|
if (READ(BTN_EN2) == 0) newbutton |= EN_B;
|
|
@@ -1691,10 +1691,10 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
|
1691
|
1691
|
if (millis() > next_button_update_ms && READ(BTN_ENC) == 0) newbutton |= EN_C;
|
1692
|
1692
|
#endif
|
1693
|
1693
|
buttons = newbutton;
|
1694
|
|
- #ifdef LCD_HAS_SLOW_BUTTONS
|
|
1694
|
+ #if ENABLED(LCD_HAS_SLOW_BUTTONS)
|
1695
|
1695
|
buttons |= slow_buttons;
|
1696
|
1696
|
#endif
|
1697
|
|
- #ifdef REPRAPWORLD_KEYPAD
|
|
1697
|
+ #if ENABLED(REPRAPWORLD_KEYPAD)
|
1698
|
1698
|
// for the reprapworld_keypad
|
1699
|
1699
|
uint8_t newbutton_reprapworld_keypad=0;
|
1700
|
1700
|
WRITE(SHIFT_LD, LOW);
|
|
@@ -1749,7 +1749,7 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
|
1749
|
1749
|
}
|
1750
|
1750
|
|
1751
|
1751
|
bool lcd_detected(void) {
|
1752
|
|
- #if (defined(LCD_I2C_TYPE_MCP23017) || defined(LCD_I2C_TYPE_MCP23008)) && defined(DETECT_DEVICE)
|
|
1752
|
+ #if (ENABLED(LCD_I2C_TYPE_MCP23017) || ENABLED(LCD_I2C_TYPE_MCP23008)) && ENABLED(DETECT_DEVICE)
|
1753
|
1753
|
return lcd.LcdDetected() == 1;
|
1754
|
1754
|
#else
|
1755
|
1755
|
return true;
|
|
@@ -1993,7 +1993,7 @@ char *ftostr52(const float &x) {
|
1993
|
1993
|
return conv;
|
1994
|
1994
|
}
|
1995
|
1995
|
|
1996
|
|
-#ifdef MANUAL_BED_LEVELING
|
|
1996
|
+#if ENABLED(MANUAL_BED_LEVELING)
|
1997
|
1997
|
|
1998
|
1998
|
static int _lcd_level_bed_position;
|
1999
|
1999
|
|