|
@@ -49,8 +49,10 @@
|
49
|
49
|
#if defined(BTN_ENC) && BTN_ENC > -1
|
50
|
50
|
// the pause/stop/restart button is connected to BTN_ENC when used
|
51
|
51
|
#define B_ST (EN_C) // Map the pause/stop/resume button into its normalized functional name
|
|
52
|
+ #undef LCD_CLICKED
|
52
|
53
|
#define LCD_CLICKED (buttons&(B_MI|B_RI|B_ST)) // pause/stop button also acts as click until we implement proper pause/stop.
|
53
|
54
|
#else
|
|
55
|
+ #undef LCD_CLICKED
|
54
|
56
|
#define LCD_CLICKED (buttons&(B_MI|B_RI))
|
55
|
57
|
#endif
|
56
|
58
|
|
|
@@ -64,11 +66,13 @@
|
64
|
66
|
|
65
|
67
|
#define B_MI (PANELOLU2_ENCODER_C<<B_I2C_BTN_OFFSET) // requires LiquidTWI2 library v1.2.3 or later
|
66
|
68
|
|
|
69
|
+ #undef LCD_CLICKED
|
67
|
70
|
#define LCD_CLICKED (buttons&B_MI)
|
68
|
71
|
|
69
|
72
|
// I2C buttons take too long to read inside an interrupt context and so we read them during lcd_update
|
70
|
73
|
#define LCD_HAS_SLOW_BUTTONS
|
71
|
74
|
#else
|
|
75
|
+ #undef LCD_CLICKED
|
72
|
76
|
#define LCD_CLICKED (buttons&EN_C)
|
73
|
77
|
#endif
|
74
|
78
|
|
|
@@ -206,6 +210,10 @@
|
206
|
210
|
#define LCD_STR_PROGRESS "\x03\x04\x05"
|
207
|
211
|
#endif
|
208
|
212
|
|
|
213
|
+#if ENABLED(LCD_HAS_STATUS_INDICATORS)
|
|
214
|
+ static void lcd_implementation_update_indicators();
|
|
215
|
+#endif
|
|
216
|
+
|
209
|
217
|
static void lcd_set_custom_characters(
|
210
|
218
|
#if ENABLED(LCD_PROGRESS_BAR)
|
211
|
219
|
bool progress_bar_set = true
|
|
@@ -362,13 +370,13 @@ static void lcd_implementation_init(
|
362
|
370
|
lcd.begin(LCD_WIDTH, LCD_HEIGHT);
|
363
|
371
|
#ifdef LCD_I2C_PIN_BL
|
364
|
372
|
lcd.setBacklightPin(LCD_I2C_PIN_BL, POSITIVE);
|
365
|
|
- lcd.setBacklight(HIGH);
|
|
373
|
+ lcd_implementation_update_indicators();
|
366
|
374
|
#endif
|
367
|
375
|
|
368
|
376
|
#elif ENABLED(LCD_I2C_TYPE_MCP23017)
|
369
|
377
|
lcd.setMCPType(LTI_TYPE_MCP23017);
|
370
|
378
|
lcd.begin(LCD_WIDTH, LCD_HEIGHT);
|
371
|
|
- lcd.setBacklight(0); //set all the LEDs off to begin with
|
|
379
|
+ lcd_implementation_update_indicators();
|
372
|
380
|
|
373
|
381
|
#elif ENABLED(LCD_I2C_TYPE_MCP23008)
|
374
|
382
|
lcd.setMCPType(LTI_TYPE_MCP23008);
|
|
@@ -835,21 +843,19 @@ void lcd_implementation_drawedit(const char* pstr, char* value) {
|
835
|
843
|
#if ENABLED(LCD_HAS_STATUS_INDICATORS)
|
836
|
844
|
|
837
|
845
|
static void lcd_implementation_update_indicators() {
|
838
|
|
- #if ENABLED(LCD_I2C_PANELOLU2) || ENABLED(LCD_I2C_VIKI)
|
839
|
|
- // Set the LEDS - referred to as backlights by the LiquidTWI2 library
|
840
|
|
- static uint8_t ledsprev = 0;
|
841
|
|
- uint8_t leds = 0;
|
842
|
|
- if (target_temperature_bed > 0) leds |= LED_A;
|
843
|
|
- if (target_temperature[0] > 0) leds |= LED_B;
|
844
|
|
- if (fanSpeed) leds |= LED_C;
|
845
|
|
- #if EXTRUDERS > 1
|
846
|
|
- if (target_temperature[1] > 0) leds |= LED_C;
|
847
|
|
- #endif
|
848
|
|
- if (leds != ledsprev) {
|
849
|
|
- lcd.setBacklight(leds);
|
850
|
|
- ledsprev = leds;
|
851
|
|
- }
|
|
846
|
+ // Set the LEDS - referred to as backlights by the LiquidTWI2 library
|
|
847
|
+ static uint8_t ledsprev = 0;
|
|
848
|
+ uint8_t leds = 0;
|
|
849
|
+ if (target_temperature_bed > 0) leds |= LED_A;
|
|
850
|
+ if (target_temperature[0] > 0) leds |= LED_B;
|
|
851
|
+ if (fanSpeed) leds |= LED_C;
|
|
852
|
+ #if EXTRUDERS > 1
|
|
853
|
+ if (target_temperature[1] > 0) leds |= LED_C;
|
852
|
854
|
#endif
|
|
855
|
+ if (leds != ledsprev) {
|
|
856
|
+ lcd.setBacklight(leds);
|
|
857
|
+ ledsprev = leds;
|
|
858
|
+ }
|
853
|
859
|
}
|
854
|
860
|
|
855
|
861
|
#endif // LCD_HAS_STATUS_INDICATORS
|