Pārlūkot izejas kodu

Merge pull request #2848 from japzi/RCBugFix

Fixing Rigidbot LCD Panel Support
Scott Lahteine 8 gadus atpakaļ
vecāks
revīzija
62bad1b60f

+ 1
- 5
Marlin/cardreader.cpp Parādīt failu

@@ -195,11 +195,7 @@ void CardReader::initsd() {
195 195
   cardOK = false;
196 196
   if (root.isOpen()) root.close();
197 197
 
198
-  #if ENABLED(SDEXTRASLOW)
199
-    #define SPI_SPEED SPI_QUARTER_SPEED
200
-  #elif ENABLED(SDSLOW)
201
-    #define SPI_SPEED SPI_HALF_SPEED
202
-  #else
198
+  #ifndef SPI_SPEED
203 199
     #define SPI_SPEED SPI_FULL_SPEED
204 200
   #endif
205 201
 

+ 1
- 2
Marlin/example_configurations/Felix/Configuration.h Parādīt failu

@@ -649,8 +649,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
649 649
 //#define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
650 650
 //#define SDSUPPORT // Enable SD Card Support in Hardware Console
651 651
 // Changed behaviour! If you need SDSUPPORT uncomment it!
652
-//#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
653
-//#define SDEXTRASLOW // Use even slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
652
+//#define SPI_SPEED SPI_HALF_SPEED // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
654 653
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
655 654
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
656 655
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking

+ 1
- 2
Marlin/example_configurations/Felix/Configuration_DUAL.h Parādīt failu

@@ -618,8 +618,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
618 618
 //#define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
619 619
 //#define SDSUPPORT // Enable SD Card Support in Hardware Console
620 620
 // Changed behaviour! If you need SDSUPPORT uncomment it!
621
-//#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
622
-//#define SDEXTRASLOW // Use even slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
621
+//#define SPI_SPEED SPI_HALF_SPEED // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
623 622
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
624 623
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
625 624
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking

+ 1
- 2
Marlin/example_configurations/Hephestos/Configuration.h Parādīt failu

@@ -658,8 +658,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
658 658
 #define ULTRA_LCD  //general LCD support, also 16x2
659 659
 //#define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
660 660
 #define SDSUPPORT // Enable SD Card Support in Hardware Console
661
-//#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
662
-//#define SDEXTRASLOW // Use even slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
661
+//#define SPI_SPEED SPI_HALF_SPEED // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
663 662
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
664 663
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
665 664
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking

+ 1
- 2
Marlin/example_configurations/K8200/Configuration.h Parādīt failu

@@ -654,8 +654,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
654 654
 //#define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
655 655
 //#define SDSUPPORT // Enable SD Card Support in Hardware Console
656 656
 // Changed behaviour! If you need SDSUPPORT uncomment it!
657
-//#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
658
-//#define SDEXTRASLOW // Use even slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
657
+//#define SPI_SPEED SPI_HALF_SPEED // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
659 658
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
660 659
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
661 660
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking

+ 1
- 2
Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h Parādīt failu

@@ -666,8 +666,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
666 666
 #define ULTRA_LCD  //general LCD support, also 16x2
667 667
 //#define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
668 668
 #define SDSUPPORT // Enable SD Card Support in Hardware Console
669
-//#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
670
-//#define SDEXTRASLOW // Use even slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
669
+//#define SPI_SPEED SPI_HALF_SPEED // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
671 670
 #define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
672 671
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
673 672
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking

+ 8
- 4
Marlin/example_configurations/RigidBot/Configuration.h Parādīt failu

@@ -219,6 +219,11 @@ Here are some standard links for getting your machine calibrated:
219 219
   //#define  DEFAULT_Ki 0.85
220 220
   //#define  DEFAULT_Kd 245
221 221
 
222
+  // E3D w/ rigidbot cartridge
223
+  //#define  DEFAULT_Kp 16.30
224
+  //#define  DEFAULT_Ki 0.95
225
+  //#define  DEFAULT_Kd 69.69
226
+
222 227
 #endif // PIDTEMP
223 228
 
224 229
 //===========================================================================
@@ -611,7 +616,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
611 616
 // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
612 617
 // M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
613 618
 //define this to enable EEPROM support
614
-//#define EEPROM_SETTINGS
619
+#define EEPROM_SETTINGS
615 620
 
616 621
 #if ENABLED(EEPROM_SETTINGS)
617 622
   // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
@@ -651,10 +656,9 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
651 656
 
652 657
 //#define ULTRA_LCD  //general LCD support, also 16x2
653 658
 //#define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
654
-//#define SDSUPPORT // Enable SD Card Support in Hardware Console
659
+#define SDSUPPORT // Enable SD Card Support in Hardware Console
655 660
 // Changed behaviour! If you need SDSUPPORT uncomment it!
656
-//#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
657
-//#define SDEXTRASLOW // Use even slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
661
+#define SPI_SPEED SPI_EIGHTH_SPEED // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
658 662
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
659 663
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
660 664
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking

+ 4
- 4
Marlin/example_configurations/RigidBot/Configuration_adv.h Parādīt failu

@@ -279,9 +279,9 @@
279 279
 //=============================Additional Features===========================
280 280
 //===========================================================================
281 281
 
282
-#define ENCODER_RATE_MULTIPLIER         // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
283
-#define ENCODER_10X_STEPS_PER_SEC 75    // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
284
-#define ENCODER_100X_STEPS_PER_SEC 160  // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
282
+//#define ENCODER_RATE_MULTIPLIER         // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
283
+//#define ENCODER_10X_STEPS_PER_SEC 75    // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
284
+//#define ENCODER_100X_STEPS_PER_SEC 160  // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
285 285
 
286 286
 //#define CHDK 4        //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
287 287
 #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
@@ -414,7 +414,7 @@ const unsigned int dropsegments = 5; //everything with less than this number of
414 414
 
415 415
 //The ASCII buffer for receiving from the serial:
416 416
 #define MAX_CMD_SIZE 96
417
-#define BUFSIZE 4
417
+#define BUFSIZE 8
418 418
 
419 419
 // Bad Serial-connections can miss a received command by sending an 'ok'
420 420
 // Therefore some clients abort after 30 seconds in a timeout.

+ 1
- 2
Marlin/example_configurations/SCARA/Configuration.h Parādīt failu

@@ -674,8 +674,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
674 674
 //#define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
675 675
 //#define SDSUPPORT // Enable SD Card Support in Hardware Console
676 676
 // Changed behaviour! If you need SDSUPPORT uncomment it!
677
-//#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
678
-//#define SDEXTRASLOW // Use even slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
677
+//#define SPI_SPEED SPI_HALF_SPEED // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
679 678
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
680 679
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
681 680
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking

+ 1
- 2
Marlin/example_configurations/TAZ4/Configuration.h Parādīt failu

@@ -685,8 +685,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
685 685
 //#define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
686 686
 //#define SDSUPPORT // Enable SD Card Support in Hardware Console
687 687
 // Changed behaviour! If you need SDSUPPORT uncomment it!
688
-//#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
689
-//#define SDEXTRASLOW // Use even slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
688
+//#define SPI_SPEED SPI_HALF_SPEED // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
690 689
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
691 690
 #define ENCODER_PULSES_PER_STEP 2 // Increase if you have a high resolution encoder
692 691
 #define ENCODER_STEPS_PER_MENU_ITEM 1 // Set according to ENCODER_PULSES_PER_STEP or your liking

+ 1
- 2
Marlin/example_configurations/WITBOX/Configuration.h Parādīt failu

@@ -657,8 +657,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
657 657
 #define ULTRA_LCD  //general LCD support, also 16x2
658 658
 //#define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
659 659
 #define SDSUPPORT // Enable SD Card Support in Hardware Console
660
-//#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
661
-//#define SDEXTRASLOW // Use even slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
660
+//#define SPI_SPEED SPI_HALF_SPEED // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
662 661
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
663 662
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
664 663
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking

+ 1
- 2
Marlin/example_configurations/adafruit/ST7565/Configuration.h Parādīt failu

@@ -666,8 +666,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
666 666
 //#define ULTRA_LCD  //general LCD support, also 16x2
667 667
 //#define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
668 668
 #define SDSUPPORT // Enable SD Card Support in Hardware Console
669
-#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
670
-//#define SDEXTRASLOW // Use even slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
669
+#define SPI_SPEED SPI_HALF_SPEED // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
671 670
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
672 671
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
673 672
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking

+ 1
- 2
Marlin/example_configurations/delta/biv2.5/Configuration.h Parādīt failu

@@ -788,8 +788,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
788 788
 //#define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
789 789
 //#define SDSUPPORT // Enable SD Card Support in Hardware Console
790 790
 // Changed behaviour! If you need SDSUPPORT uncomment it!
791
-//#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
792
-//#define SDEXTRASLOW // Use even slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
791
+//#define SPI_SPEED SPI_HALF_SPEED // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
793 792
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
794 793
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
795 794
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking

+ 1
- 2
Marlin/example_configurations/delta/generic/Configuration.h Parādīt failu

@@ -789,8 +789,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
789 789
 //#define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
790 790
 //#define SDSUPPORT // Enable SD Card Support in Hardware Console
791 791
 // Changed behaviour! If you need SDSUPPORT uncomment it!
792
-//#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
793
-//#define SDEXTRASLOW // Use even slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
792
+//#define SPI_SPEED SPI_HALF_SPEED // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
794 793
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
795 794
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
796 795
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking

+ 1
- 2
Marlin/example_configurations/delta/kossel_mini/Configuration.h Parādīt failu

@@ -793,8 +793,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
793 793
 //#define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
794 794
 //#define SDSUPPORT // Enable SD Card Support in Hardware Console
795 795
 // Changed behaviour! If you need SDSUPPORT uncomment it!
796
-//#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
797
-//#define SDEXTRASLOW // Use even slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
796
+//#define SPI_SPEED SPI_HALF_SPEED // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
798 797
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
799 798
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
800 799
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking

+ 1
- 2
Marlin/example_configurations/delta/kossel_pro/Configuration.h Parādīt failu

@@ -783,8 +783,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
783 783
 //#define ULTRA_LCD  //general LCD support, also 16x2
784 784
 //#define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
785 785
 #define SDSUPPORT // Enable SD Card Support in Hardware Console
786
-//#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
787
-//#define SDEXTRASLOW // Use even slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
786
+//#define SPI_SPEED SPI_HALF_SPEED // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
788 787
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
789 788
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
790 789
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking

+ 1
- 2
Marlin/example_configurations/makibox/Configuration.h Parādīt failu

@@ -668,8 +668,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
668 668
 //#define ULTRA_LCD  //general LCD support, also 16x2
669 669
 //#define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
670 670
 #define SDSUPPORT // Enable SD Card Support in Hardware Console
671
-#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
672
-//#define SDEXTRASLOW // Use even slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
671
+#define SPI_SPEED SPI_HALF_SPEED // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
673 672
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
674 673
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
675 674
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking

+ 1
- 2
Marlin/example_configurations/tvrrug/Round2/Configuration.h Parādīt failu

@@ -661,8 +661,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
661 661
 //#define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
662 662
 //#define SDSUPPORT // Enable SD Card Support in Hardware Console
663 663
 // Changed behaviour! If you need SDSUPPORT uncomment it!
664
-//#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
665
-//#define SDEXTRASLOW // Use even slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
664
+//#define SPI_SPEED SPI_HALF_SPEED // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
666 665
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
667 666
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
668 667
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking

+ 16
- 15
Marlin/pins_RIGIDBOARD.h Parādīt failu

@@ -5,7 +5,10 @@
5 5
 #include "pins_RAMPS_13.h"
6 6
 
7 7
 #if ENABLED(Z_MIN_PROBE_ENDSTOP)
8
-  #define Z_MIN_PROBE_PIN  19
8
+  #undef Z_MAX_PIN
9
+  #define Z_MAX_PIN -1
10
+  #undef Z_MIN_PROBE_PIN
11
+  #define Z_MIN_PROBE_PIN  19    // Z-MAX pin J14 End Stops
9 12
 #endif
10 13
 
11 14
 #undef HEATER_0_PIN
@@ -25,24 +28,22 @@
25 28
   #undef BEEPER_PIN
26 29
   #define BEEPER_PIN -1
27 30
 
28
-  #undef SD_DETECT_PIN
29
-  #define SD_DETECT_PIN 22
30
-
31
-  // Extra button definitions, substitute for EN1 / EN2
32
-  #define BTN_UP  37 // BTN_EN1
33
-  #define BTN_DWN 35 // BTN_EN2
34
-  #define BTN_LFT 33
35
-  #define BTN_RT  32
36
-
37
-  // Marlin can respond to UP/DOWN by default
38
-  // #undef  BTN_EN1
39
-  // #undef  BTN_EN2
40
-  //#define BTN_EN1 -1
41
-  //#define BTN_EN2 -1
31
+  // Direction buttons
32
+  #define BTN_UP           37
33
+  #define BTN_DWN          35
34
+  #define BTN_LFT          33
35
+  #define BTN_RT           32
42 36
 
37
+  // 'R' button
43 38
   #undef  BTN_ENC
44 39
   #define BTN_ENC 31
45 40
 
41
+  // Disable encoder
42
+  #undef  BTN_EN1
43
+  #define BTN_EN1 -1
44
+  #undef  BTN_EN2
45
+  #define BTN_EN2 -1
46
+
46 47
   #undef  SD_DETECT_PIN
47 48
   #define SD_DETECT_PIN 22
48 49
 

+ 46
- 8
Marlin/ultralcd.cpp Parādīt failu

@@ -1524,11 +1524,15 @@ void lcd_init() {
1524 1524
   lcd_implementation_init();
1525 1525
 
1526 1526
   #if ENABLED(NEWPANEL)
1527
+    #if BTN_EN1 > 0
1528
+      SET_INPUT(BTN_EN1);
1529
+      WRITE(BTN_EN1, HIGH);
1530
+    #endif
1527 1531
 
1528
-    SET_INPUT(BTN_EN1);
1529
-    SET_INPUT(BTN_EN2);
1530
-    WRITE(BTN_EN1, HIGH);
1531
-    WRITE(BTN_EN2, HIGH);
1532
+    #if BTN_EN2 > 0
1533
+      SET_INPUT(BTN_EN2);
1534
+      WRITE(BTN_EN2, HIGH);
1535
+    #endif
1532 1536
 
1533 1537
     #if BTN_ENC > 0
1534 1538
       SET_INPUT(BTN_ENC);
@@ -1543,6 +1547,13 @@ void lcd_init() {
1543 1547
       WRITE(SHIFT_LD, HIGH);
1544 1548
     #endif
1545 1549
 
1550
+    #ifdef RIGIDBOT_PANEL
1551
+      SET_INPUT(BTN_UP);
1552
+      SET_INPUT(BTN_DWN);
1553
+      SET_INPUT(BTN_LFT);
1554
+      SET_INPUT(BTN_RT);
1555
+    #endif
1556
+
1546 1557
   #else  // Not NEWPANEL
1547 1558
 
1548 1559
     #if ENABLED(SR_LCD_2W_NL) // Non latching 2 wire shift register
@@ -1670,7 +1681,7 @@ void lcd_update() {
1670 1681
               int32_t encoderMovementSteps = abs(encoderDiff) / ENCODER_PULSES_PER_STEP;
1671 1682
 
1672 1683
               if (lastEncoderMovementMillis != 0) {
1673
-                // Note that the rate is always calculated between to passes through the 
1684
+                // Note that the rate is always calculated between to passes through the
1674 1685
                 // loop and that the abs of the encoderDiff value is tracked.
1675 1686
                 float encoderStepRate = (float)(encoderMovementSteps) / ((float)(ms - lastEncoderMovementMillis)) * 1000.0;
1676 1687
 
@@ -1843,10 +1854,37 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
1843 1854
   void lcd_buttons_update() {
1844 1855
     #if ENABLED(NEWPANEL)
1845 1856
       uint8_t newbutton = 0;
1846
-      if (READ(BTN_EN1) == 0) newbutton |= EN_A;
1847
-      if (READ(BTN_EN2) == 0) newbutton |= EN_B;
1857
+      #if BTN_EN1 > 0
1858
+        if (READ(BTN_EN1) == 0) newbutton |= EN_A;
1859
+      #endif
1860
+      #if BTN_EN2 > 0
1861
+        if (READ(BTN_EN2) == 0) newbutton |= EN_B;
1862
+      #endif
1863
+      #if ENABLED(RIGIDBOT_PANEL) || BTN_ENC > 0
1864
+        millis_t now = millis();
1865
+      #endif
1866
+      #if ENABLED(RIGIDBOT_PANEL)
1867
+        if (now > next_button_update_ms) {
1868
+          if (READ(BTN_UP) == 0) {
1869
+            encoderDiff = -1 * ENCODER_STEPS_PER_MENU_ITEM;
1870
+            next_button_update_ms = now + 300;
1871
+          }
1872
+          else if (READ(BTN_DWN) == 0) {
1873
+            encoderDiff = ENCODER_STEPS_PER_MENU_ITEM;
1874
+            next_button_update_ms = now + 300;
1875
+          }
1876
+          else if (READ(BTN_LFT) == 0) {
1877
+            encoderDiff = -1 * ENCODER_PULSES_PER_STEP;
1878
+            next_button_update_ms = now + 300;
1879
+          }
1880
+          else if (READ(BTN_RT) == 0) {
1881
+            encoderDiff = ENCODER_PULSES_PER_STEP;
1882
+            next_button_update_ms = now + 300;
1883
+          }
1884
+        }
1885
+      #endif
1848 1886
       #if BTN_ENC > 0
1849
-        if (millis() > next_button_update_ms && READ(BTN_ENC) == 0) newbutton |= EN_C;
1887
+        if (now > next_button_update_ms && READ(BTN_ENC) == 0) newbutton |= EN_C;
1850 1888
       #endif
1851 1889
       buttons = newbutton;
1852 1890
       #if ENABLED(LCD_HAS_SLOW_BUTTONS)

Notiek ielāde…
Atcelt
Saglabāt