|
@@ -90,12 +90,16 @@ static void menu_action_setting_edit_callback_long5(const char* pstr, unsigned l
|
90
|
90
|
#define ENCODER_FEEDRATE_DEADZONE 10
|
91
|
91
|
|
92
|
92
|
#if !defined(LCD_I2C_VIKI)
|
93
|
|
- #define ENCODER_STEPS_PER_MENU_ITEM 5
|
|
93
|
+ #ifndef ENCODER_STEPS_PER_MENU_ITEM
|
|
94
|
+ #define ENCODER_STEPS_PER_MENU_ITEM 5
|
|
95
|
+ #endif
|
94
|
96
|
#ifndef ENCODER_PULSES_PER_STEP
|
95
|
97
|
#define ENCODER_PULSES_PER_STEP 1
|
96
|
98
|
#endif
|
97
|
99
|
#else
|
98
|
|
- #define ENCODER_STEPS_PER_MENU_ITEM 2 // VIKI LCD rotary encoder uses a different number of steps per rotation
|
|
100
|
+ #ifndef ENCODER_STEPS_PER_MENU_ITEM
|
|
101
|
+ #define ENCODER_STEPS_PER_MENU_ITEM 2 // VIKI LCD rotary encoder uses a different number of steps per rotation
|
|
102
|
+ #endif
|
99
|
103
|
#ifndef ENCODER_PULSES_PER_STEP
|
100
|
104
|
#define ENCODER_PULSES_PER_STEP 1
|
101
|
105
|
#endif
|
|
@@ -207,7 +211,7 @@ static void lcd_status_screen()
|
207
|
211
|
else if (feedmultiply == 100 && int(encoderPosition) < -ENCODER_FEEDRATE_DEADZONE)
|
208
|
212
|
{
|
209
|
213
|
feedmultiply += int(encoderPosition) + ENCODER_FEEDRATE_DEADZONE;
|
210
|
|
- encoderPosition = 0;
|
|
214
|
+ encoderPosition = 0;
|
211
|
215
|
}
|
212
|
216
|
else if (feedmultiply != 100)
|
213
|
217
|
{
|
|
@@ -407,7 +411,7 @@ static void lcd_tune_menu()
|
407
|
411
|
#endif
|
408
|
412
|
MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255);
|
409
|
413
|
MENU_ITEM_EDIT(int3, MSG_FLOW, &extrudemultiply, 10, 999);
|
410
|
|
-
|
|
414
|
+
|
411
|
415
|
#ifdef BABYSTEPPING
|
412
|
416
|
#ifdef BABYSTEP_XY
|
413
|
417
|
MENU_ITEM(submenu, "Babystep X", lcd_babystep_x);
|
|
@@ -719,7 +723,7 @@ static void lcd_control_motion_menu()
|
719
|
723
|
MENU_ITEM_EDIT(float52, MSG_XSTEPS, &axis_steps_per_unit[X_AXIS], 5, 9999);
|
720
|
724
|
MENU_ITEM_EDIT(float52, MSG_YSTEPS, &axis_steps_per_unit[Y_AXIS], 5, 9999);
|
721
|
725
|
MENU_ITEM_EDIT(float51, MSG_ZSTEPS, &axis_steps_per_unit[Z_AXIS], 5, 9999);
|
722
|
|
- MENU_ITEM_EDIT(float51, MSG_ESTEPS, &axis_steps_per_unit[E_AXIS], 5, 9999);
|
|
726
|
+ MENU_ITEM_EDIT(float51, MSG_ESTEPS, &axis_steps_per_unit[E_AXIS], 5, 9999);
|
723
|
727
|
#ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
|
724
|
728
|
MENU_ITEM_EDIT(bool, "Endstop abort", &abort_on_endstop_hit);
|
725
|
729
|
#endif
|
|
@@ -781,7 +785,7 @@ static void lcd_sd_updir()
|
781
|
785
|
|
782
|
786
|
void lcd_sdcard_menu()
|
783
|
787
|
{
|
784
|
|
- if (lcdDrawUpdate == 0 && LCD_CLICKED == 0)
|
|
788
|
+ if (lcdDrawUpdate == 0 && LCD_CLICKED == 0)
|
785
|
789
|
return; // nothing to do (so don't thrash the SD card)
|
786
|
790
|
uint16_t fileCnt = card.getnrfilenames();
|
787
|
791
|
START_MENU();
|
|
@@ -795,7 +799,7 @@ void lcd_sdcard_menu()
|
795
|
799
|
}else{
|
796
|
800
|
MENU_ITEM(function, LCD_STR_FOLDER "..", lcd_sd_updir);
|
797
|
801
|
}
|
798
|
|
-
|
|
802
|
+
|
799
|
803
|
for(uint16_t i=0;i<fileCnt;i++)
|
800
|
804
|
{
|
801
|
805
|
if (_menuItemNr == _lineNr)
|
|
@@ -982,14 +986,14 @@ void lcd_init()
|
982
|
986
|
|
983
|
987
|
#ifdef NEWPANEL
|
984
|
988
|
pinMode(BTN_EN1,INPUT);
|
985
|
|
- pinMode(BTN_EN2,INPUT);
|
|
989
|
+ pinMode(BTN_EN2,INPUT);
|
986
|
990
|
pinMode(SDCARDDETECT,INPUT);
|
987
|
991
|
WRITE(BTN_EN1,HIGH);
|
988
|
992
|
WRITE(BTN_EN2,HIGH);
|
989
|
993
|
#if BTN_ENC > 0
|
990
|
|
- pinMode(BTN_ENC,INPUT);
|
|
994
|
+ pinMode(BTN_ENC,INPUT);
|
991
|
995
|
WRITE(BTN_ENC,HIGH);
|
992
|
|
- #endif
|
|
996
|
+ #endif
|
993
|
997
|
#ifdef REPRAPWORLD_KEYPAD
|
994
|
998
|
pinMode(SHIFT_CLK,OUTPUT);
|
995
|
999
|
pinMode(SHIFT_LD,OUTPUT);
|
|
@@ -1007,9 +1011,9 @@ void lcd_init()
|
1007
|
1011
|
pinMode(SHIFT_EN,OUTPUT);
|
1008
|
1012
|
pinMode(SHIFT_OUT,INPUT);
|
1009
|
1013
|
WRITE(SHIFT_OUT,HIGH);
|
1010
|
|
- WRITE(SHIFT_LD,HIGH);
|
|
1014
|
+ WRITE(SHIFT_LD,HIGH);
|
1011
|
1015
|
WRITE(SHIFT_EN,LOW);
|
1012
|
|
- #endif // SR_LCD_2W_NL
|
|
1016
|
+ #endif // SR_LCD_2W_NL
|
1013
|
1017
|
#endif//!NEWPANEL
|
1014
|
1018
|
|
1015
|
1019
|
#if (SDCARDDETECT > 0)
|
|
@@ -1020,28 +1024,28 @@ void lcd_init()
|
1020
|
1024
|
slow_buttons = 0;
|
1021
|
1025
|
#endif
|
1022
|
1026
|
lcd_buttons_update();
|
1023
|
|
-#ifdef ULTIPANEL
|
|
1027
|
+#ifdef ULTIPANEL
|
1024
|
1028
|
encoderDiff = 0;
|
1025
|
|
-#endif
|
|
1029
|
+#endif
|
1026
|
1030
|
}
|
1027
|
1031
|
|
1028
|
1032
|
void lcd_update()
|
1029
|
1033
|
{
|
1030
|
1034
|
static unsigned long timeoutToStatus = 0;
|
1031
|
|
-
|
|
1035
|
+
|
1032
|
1036
|
#ifdef LCD_HAS_SLOW_BUTTONS
|
1033
|
1037
|
slow_buttons = lcd_implementation_read_slow_buttons(); // buttons which take too long to read in interrupt context
|
1034
|
1038
|
#endif
|
1035
|
|
-
|
|
1039
|
+
|
1036
|
1040
|
lcd_buttons_update();
|
1037
|
|
-
|
|
1041
|
+
|
1038
|
1042
|
#if (SDCARDDETECT > 0)
|
1039
|
1043
|
if((IS_SD_INSERTED != lcd_oldcardstatus))
|
1040
|
1044
|
{
|
1041
|
1045
|
lcdDrawUpdate = 2;
|
1042
|
1046
|
lcd_oldcardstatus = IS_SD_INSERTED;
|
1043
|
1047
|
lcd_implementation_init(); // to maybe revive the lcd if static electricty killed it.
|
1044
|
|
-
|
|
1048
|
+
|
1045
|
1049
|
if(lcd_oldcardstatus)
|
1046
|
1050
|
{
|
1047
|
1051
|
card.initsd();
|
|
@@ -1054,7 +1058,7 @@ void lcd_update()
|
1054
|
1058
|
}
|
1055
|
1059
|
}
|
1056
|
1060
|
#endif//CARDINSERTED
|
1057
|
|
-
|
|
1061
|
+
|
1058
|
1062
|
if (lcd_next_update_millis < millis())
|
1059
|
1063
|
{
|
1060
|
1064
|
#ifdef ULTIPANEL
|
|
@@ -1095,7 +1099,7 @@ void lcd_update()
|
1095
|
1099
|
#ifdef DOGLCD // Changes due to different driver architecture of the DOGM display
|
1096
|
1100
|
blink++; // Variable for fan animation and alive dot
|
1097
|
1101
|
u8g.firstPage();
|
1098
|
|
- do
|
|
1102
|
+ do
|
1099
|
1103
|
{
|
1100
|
1104
|
u8g.setFont(u8g_font_6x10_marlin);
|
1101
|
1105
|
u8g.setPrintPos(125,0);
|
|
@@ -1105,7 +1109,7 @@ void lcd_update()
|
1105
|
1109
|
(*currentMenu)();
|
1106
|
1110
|
if (!lcdDrawUpdate) break; // Terminate display update, when nothing new to draw. This must be done before the last dogm.next()
|
1107
|
1111
|
} while( u8g.nextPage() );
|
1108
|
|
-#else
|
|
1112
|
+#else
|
1109
|
1113
|
(*currentMenu)();
|
1110
|
1114
|
#endif
|
1111
|
1115
|
|
|
@@ -1159,7 +1163,7 @@ void lcd_reset_alert_level()
|
1159
|
1163
|
void lcd_setcontrast(uint8_t value)
|
1160
|
1164
|
{
|
1161
|
1165
|
lcd_contrast = value & 63;
|
1162
|
|
- u8g.setContrast(lcd_contrast);
|
|
1166
|
+ u8g.setContrast(lcd_contrast);
|
1163
|
1167
|
}
|
1164
|
1168
|
#endif
|
1165
|
1169
|
|
|
@@ -1199,7 +1203,7 @@ void lcd_buttons_update()
|
1199
|
1203
|
WRITE(SHIFT_LD,HIGH);
|
1200
|
1204
|
unsigned char tmp_buttons=0;
|
1201
|
1205
|
for(int8_t i=0;i<8;i++)
|
1202
|
|
- {
|
|
1206
|
+ {
|
1203
|
1207
|
newbutton = newbutton>>1;
|
1204
|
1208
|
if(READ(SHIFT_OUT))
|
1205
|
1209
|
newbutton|=(1<<7);
|
|
@@ -1249,14 +1253,14 @@ void lcd_buttons_update()
|
1249
|
1253
|
}
|
1250
|
1254
|
|
1251
|
1255
|
void lcd_buzz(long duration, uint16_t freq)
|
1252
|
|
-{
|
|
1256
|
+{
|
1253
|
1257
|
#ifdef LCD_USE_I2C_BUZZER
|
1254
|
1258
|
lcd.buzz(duration,freq);
|
1255
|
|
-#endif
|
|
1259
|
+#endif
|
1256
|
1260
|
}
|
1257
|
1261
|
|
1258
|
|
-bool lcd_clicked()
|
1259
|
|
-{
|
|
1262
|
+bool lcd_clicked()
|
|
1263
|
+{
|
1260
|
1264
|
return LCD_CLICKED;
|
1261
|
1265
|
}
|
1262
|
1266
|
#endif//ULTIPANEL
|