|
@@ -218,6 +218,9 @@ static void lcd_status_screen();
|
218
|
218
|
#if ENABLED(REPRAPWORLD_KEYPAD)
|
219
|
219
|
volatile uint8_t buttons_reprapworld_keypad; // to store the keypad shift register values
|
220
|
220
|
#endif
|
|
221
|
+ #if ENABLED(RIGIDBOT_PANEL)
|
|
222
|
+ volatile millis_t next_fake_encoder_update_ms;
|
|
223
|
+ #endif
|
221
|
224
|
|
222
|
225
|
#if ENABLED(LCD_HAS_SLOW_BUTTONS)
|
223
|
226
|
volatile uint8_t slow_buttons; // Bits of the pressed buttons.
|
|
@@ -1524,11 +1527,15 @@ void lcd_init() {
|
1524
|
1527
|
lcd_implementation_init();
|
1525
|
1528
|
|
1526
|
1529
|
#if ENABLED(NEWPANEL)
|
|
1530
|
+ #if BTN_EN1 > 0
|
|
1531
|
+ SET_INPUT(BTN_EN1);
|
|
1532
|
+ WRITE(BTN_EN1, HIGH);
|
|
1533
|
+ #endif
|
1527
|
1534
|
|
1528
|
|
- SET_INPUT(BTN_EN1);
|
1529
|
|
- SET_INPUT(BTN_EN2);
|
1530
|
|
- WRITE(BTN_EN1, HIGH);
|
1531
|
|
- WRITE(BTN_EN2, HIGH);
|
|
1535
|
+ #if BTN_EN2 > 0
|
|
1536
|
+ SET_INPUT(BTN_EN2);
|
|
1537
|
+ WRITE(BTN_EN2, HIGH);
|
|
1538
|
+ #endif
|
1532
|
1539
|
|
1533
|
1540
|
#if BTN_ENC > 0
|
1534
|
1541
|
SET_INPUT(BTN_ENC);
|
|
@@ -1543,6 +1550,14 @@ void lcd_init() {
|
1543
|
1550
|
WRITE(SHIFT_LD, HIGH);
|
1544
|
1551
|
#endif
|
1545
|
1552
|
|
|
1553
|
+ #ifdef RIGIDBOT_PANEL
|
|
1554
|
+ pinMode(BTN_UP,INPUT);
|
|
1555
|
+ pinMode(BTN_DWN,INPUT);
|
|
1556
|
+ pinMode(BTN_LFT,INPUT);
|
|
1557
|
+ pinMode(BTN_RT,INPUT);
|
|
1558
|
+ next_fake_encoder_update_ms = 0;
|
|
1559
|
+ #endif
|
|
1560
|
+
|
1546
|
1561
|
#else // Not NEWPANEL
|
1547
|
1562
|
|
1548
|
1563
|
#if ENABLED(SR_LCD_2W_NL) // Non latching 2 wire shift register
|
|
@@ -1843,8 +1858,32 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
|
1843
|
1858
|
void lcd_buttons_update() {
|
1844
|
1859
|
#if ENABLED(NEWPANEL)
|
1845
|
1860
|
uint8_t newbutton = 0;
|
1846
|
|
- if (READ(BTN_EN1) == 0) newbutton |= EN_A;
|
1847
|
|
- if (READ(BTN_EN2) == 0) newbutton |= EN_B;
|
|
1861
|
+ #if BTN_EN1 > 0
|
|
1862
|
+ if (READ(BTN_EN1) == 0) newbutton |= EN_A;
|
|
1863
|
+ #endif
|
|
1864
|
+ #if BTN_EN2 > 0
|
|
1865
|
+ if (READ(BTN_EN2) == 0) newbutton |= EN_B;
|
|
1866
|
+ #endif
|
|
1867
|
+ #if ENABLED(RIGIDBOT_PANEL)
|
|
1868
|
+ if (millis() > next_fake_encoder_update_ms && READ(BTN_UP) == 0) {
|
|
1869
|
+ encoderDiff = -1 * ENCODER_STEPS_PER_MENU_ITEM;
|
|
1870
|
+ next_fake_encoder_update_ms = millis() + 300;
|
|
1871
|
+ }
|
|
1872
|
+ if (millis() > next_fake_encoder_update_ms && READ(BTN_DWN) == 0) {
|
|
1873
|
+ encoderDiff = ENCODER_STEPS_PER_MENU_ITEM;
|
|
1874
|
+ next_fake_encoder_update_ms = millis() + 300;
|
|
1875
|
+ }
|
|
1876
|
+ if (millis() > next_fake_encoder_update_ms && READ(BTN_LFT) == 0) {
|
|
1877
|
+ encoderDiff = -1 * ENCODER_PULSES_PER_STEP;
|
|
1878
|
+ next_fake_encoder_update_ms = millis() + 300;
|
|
1879
|
+ }
|
|
1880
|
+ if (millis() > next_fake_encoder_update_ms && READ(BTN_RT) == 0) {
|
|
1881
|
+ encoderDiff = ENCODER_PULSES_PER_STEP;
|
|
1882
|
+ next_fake_encoder_update_ms = millis() + 300;
|
|
1883
|
+ }
|
|
1884
|
+ #endif
|
|
1885
|
+
|
|
1886
|
+
|
1848
|
1887
|
#if BTN_ENC > 0
|
1849
|
1888
|
if (millis() > next_button_update_ms && READ(BTN_ENC) == 0) newbutton |= EN_C;
|
1850
|
1889
|
#endif
|