Selaa lähdekoodia

Merge pull request #3114 from thinkyhead/rc_reverse_lcd_menu

Option to reverse the click-wheel direction in menus
Scott Lahteine 8 vuotta sitten
vanhempi
commit
d56c6af24e

+ 1
- 0
Marlin/Configuration.h Näytä tiedosto

685
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
685
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
686
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
686
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
687
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
687
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
688
+//#define REVERSE_MENU_DIRECTION // When enabled CLOCKWISE moves UP in the LCD menu
688
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
689
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
689
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
690
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
690
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.
691
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.

+ 0
- 1
Marlin/dogm_lcd_implementation.h Näytä tiedosto

146
 #include "utf_mapper.h"
146
 #include "utf_mapper.h"
147
 
147
 
148
 int lcd_contrast;
148
 int lcd_contrast;
149
-static unsigned char blink = 0; // Variable for visualization of fan rotation in GLCD
150
 static char currentfont = 0;
149
 static char currentfont = 0;
151
 
150
 
152
 static void lcd_setFont(char font_nr) {
151
 static void lcd_setFont(char font_nr) {

+ 1
- 0
Marlin/example_configurations/Felix/Configuration.h Näytä tiedosto

668
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
668
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
669
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
669
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
670
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
670
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
671
+//#define REVERSE_MENU_DIRECTION // When enabled CLOCKWISE moves UP in the LCD menu
671
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
672
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
672
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
673
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
673
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.
674
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.

+ 1
- 0
Marlin/example_configurations/Felix/Configuration_DUAL.h Näytä tiedosto

665
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
665
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
666
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
666
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
667
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
667
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
668
+//#define REVERSE_MENU_DIRECTION // When enabled CLOCKWISE moves UP in the LCD menu
668
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
669
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
669
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
670
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
670
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.
671
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.

+ 1
- 0
Marlin/example_configurations/Hephestos/Configuration.h Näytä tiedosto

677
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
677
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
678
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
678
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
679
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
679
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
680
+//#define REVERSE_MENU_DIRECTION // When enabled CLOCKWISE moves UP in the LCD menu
680
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
681
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
681
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
682
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
682
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.
683
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.

+ 1
- 0
Marlin/example_configurations/Hephestos_2/Configuration.h Näytä tiedosto

680
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
680
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
681
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
681
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
682
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
682
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
683
+//#define REVERSE_MENU_DIRECTION // When enabled CLOCKWISE moves UP in the LCD menu
683
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
684
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
684
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
685
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
685
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.
686
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.

+ 1
- 0
Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h Näytä tiedosto

685
 #define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
685
 #define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
686
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
686
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
687
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
687
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
688
+//#define REVERSE_MENU_DIRECTION // When enabled CLOCKWISE moves UP in the LCD menu
688
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
689
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
689
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
690
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
690
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.
691
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.

+ 1
- 0
Marlin/example_configurations/RigidBot/Configuration.h Näytä tiedosto

680
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
680
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
681
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
681
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
682
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
682
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
683
+//#define REVERSE_MENU_DIRECTION // When enabled CLOCKWISE moves UP in the LCD menu
683
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
684
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
684
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
685
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
685
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.
686
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.

+ 1
- 0
Marlin/example_configurations/SCARA/Configuration.h Näytä tiedosto

693
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
693
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
694
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
694
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
695
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
695
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
696
+//#define REVERSE_MENU_DIRECTION // When enabled CLOCKWISE moves UP in the LCD menu
696
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
697
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
697
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
698
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
698
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.
699
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.

+ 1
- 0
Marlin/example_configurations/TAZ4/Configuration.h Näytä tiedosto

705
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
705
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
706
 #define ENCODER_PULSES_PER_STEP 2 // Increase if you have a high resolution encoder
706
 #define ENCODER_PULSES_PER_STEP 2 // Increase if you have a high resolution encoder
707
 #define ENCODER_STEPS_PER_MENU_ITEM 1 // Set according to ENCODER_PULSES_PER_STEP or your liking
707
 #define ENCODER_STEPS_PER_MENU_ITEM 1 // Set according to ENCODER_PULSES_PER_STEP or your liking
708
+//#define REVERSE_MENU_DIRECTION // When enabled CLOCKWISE moves UP in the LCD menu
708
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
709
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
709
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
710
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
710
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.
711
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.

+ 1
- 0
Marlin/example_configurations/WITBOX/Configuration.h Näytä tiedosto

677
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
677
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
678
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
678
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
679
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
679
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
680
+//#define REVERSE_MENU_DIRECTION // When enabled CLOCKWISE moves UP in the LCD menu
680
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
681
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
681
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
682
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
682
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.
683
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.

+ 1
- 0
Marlin/example_configurations/adafruit/ST7565/Configuration.h Näytä tiedosto

685
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
685
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
686
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
686
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
687
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
687
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
688
+//#define REVERSE_MENU_DIRECTION // When enabled CLOCKWISE moves UP in the LCD menu
688
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
689
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
689
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
690
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
690
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.
691
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.

+ 1
- 0
Marlin/example_configurations/delta/biv2.5/Configuration.h Näytä tiedosto

807
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
807
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
808
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
808
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
809
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
809
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
810
+//#define REVERSE_MENU_DIRECTION // When enabled CLOCKWISE moves UP in the LCD menu
810
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
811
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
811
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
812
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
812
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.
813
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.

+ 1
- 0
Marlin/example_configurations/delta/generic/Configuration.h Näytä tiedosto

807
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
807
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
808
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
808
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
809
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
809
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
810
+//#define REVERSE_MENU_DIRECTION // When enabled CLOCKWISE moves UP in the LCD menu
810
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
811
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
811
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
812
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
812
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.
813
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.

+ 1
- 0
Marlin/example_configurations/delta/kossel_mini/Configuration.h Näytä tiedosto

811
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
811
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
812
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
812
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
813
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
813
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
814
+//#define REVERSE_MENU_DIRECTION // When enabled CLOCKWISE moves UP in the LCD menu
814
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
815
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
815
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
816
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
816
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.
817
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.

+ 1
- 0
Marlin/example_configurations/delta/kossel_pro/Configuration.h Näytä tiedosto

802
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
802
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
803
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
803
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
804
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
804
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
805
+//#define REVERSE_MENU_DIRECTION // When enabled CLOCKWISE moves UP in the LCD menu
805
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
806
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
806
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
807
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
807
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.
808
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.

+ 1
- 0
Marlin/example_configurations/delta/kossel_xl/Configuration.h Näytä tiedosto

721
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
721
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
722
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
722
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
723
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
723
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
724
+//#define REVERSE_MENU_DIRECTION // When enabled CLOCKWISE moves UP in the LCD menu
724
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
725
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
725
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
726
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
726
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.
727
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.

+ 1
- 0
Marlin/example_configurations/makibox/Configuration.h Näytä tiedosto

688
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
688
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
689
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
689
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
690
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
690
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
691
+//#define REVERSE_MENU_DIRECTION // When enabled CLOCKWISE moves UP in the LCD menu
691
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
692
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
692
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
693
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
693
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.
694
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.

+ 1
- 0
Marlin/example_configurations/tvrrug/Round2/Configuration.h Näytä tiedosto

679
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
679
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
680
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
680
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
681
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
681
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
682
+//#define REVERSE_MENU_DIRECTION // When enabled CLOCKWISE moves UP in the LCD menu
682
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
683
 //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
683
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
684
 //#define ULTIPANEL  //the UltiPanel as on Thingiverse
684
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.
685
 //#define SPEAKER // The sound device is a speaker - not a buzzer. A buzzer resonates with his own frequency.

+ 65
- 17
Marlin/ultralcd.cpp Näytä tiedosto

7
 #include "stepper.h"
7
 #include "stepper.h"
8
 #include "configuration_store.h"
8
 #include "configuration_store.h"
9
 
9
 
10
+/**
11
+ * REVERSE_MENU_DIRECTION
12
+ *
13
+ * To reverse the menu direction we need a general way to reverse
14
+ * the direction of the encoder everywhere. So encoderDirection is
15
+ * added to allow the encoder to go the other way.
16
+ *
17
+ * This behavior is limited to scrolling Menus and SD card listings,
18
+ * and is disabled in other contexts.
19
+ */
20
+#if ENABLED(REVERSE_MENU_DIRECTION)
21
+  int8_t encoderDirection = 1;
22
+  #define ENCODER_DIRECTION_NORMAL() (encoderDirection = 1)
23
+  #define ENCODER_DIRECTION_MENUS() (encoderDirection = -1)
24
+#else
25
+  #define ENCODER_DIRECTION_NORMAL() ;
26
+  #define ENCODER_DIRECTION_MENUS() ;
27
+#endif
28
+
29
+uint8_t blink = 0; // Variable for animation
30
+
10
 int8_t encoderDiff; // updated from interrupt context and added to encoderPosition every LCD update
31
 int8_t encoderDiff; // updated from interrupt context and added to encoderPosition every LCD update
11
 
32
 
12
 bool encoderRateMultiplierEnabled;
33
 bool encoderRateMultiplierEnabled;
130
    * START_MENU generates the init code for a menu function
151
    * START_MENU generates the init code for a menu function
131
    */
152
    */
132
   #define START_MENU() do { \
153
   #define START_MENU() do { \
154
+    ENCODER_DIRECTION_MENUS(); \
133
     encoderRateMultiplierEnabled = false; \
155
     encoderRateMultiplierEnabled = false; \
134
     if (encoderPosition > 0x8000) encoderPosition = 0; \
156
     if (encoderPosition > 0x8000) encoderPosition = 0; \
135
     uint8_t encoderLine = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM; \
157
     uint8_t encoderLine = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM; \
209
     #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, args...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## args)
231
     #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, args...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## args)
210
   #endif //!ENCODER_RATE_MULTIPLIER
232
   #endif //!ENCODER_RATE_MULTIPLIER
211
   #define END_MENU() \
233
   #define END_MENU() \
212
-      if (encoderLine >= _menuItemNr) { encoderPosition = _menuItemNr * (ENCODER_STEPS_PER_MENU_ITEM) - 1; encoderLine = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM; }\
234
+      if (encoderLine >= _menuItemNr) { encoderPosition = _menuItemNr * (ENCODER_STEPS_PER_MENU_ITEM) - 1; encoderLine = _menuItemNr - 1; }\
213
       if (encoderLine >= currentMenuViewOffset + LCD_HEIGHT) { currentMenuViewOffset = encoderLine - (LCD_HEIGHT) + 1; lcdDrawUpdate = 1; _lineNr = currentMenuViewOffset - 1; _drawLineNr = -1; } \
235
       if (encoderLine >= currentMenuViewOffset + LCD_HEIGHT) { currentMenuViewOffset = encoderLine - (LCD_HEIGHT) + 1; lcdDrawUpdate = 1; _lineNr = currentMenuViewOffset - 1; _drawLineNr = -1; } \
214
       } } while(0)
236
       } } while(0)
215
 
237
 
280
  */
302
  */
281
 
303
 
282
 static void lcd_status_screen() {
304
 static void lcd_status_screen() {
305
+  ENCODER_DIRECTION_NORMAL();
283
   encoderRateMultiplierEnabled = false;
306
   encoderRateMultiplierEnabled = false;
284
 
307
 
285
   #if ENABLED(LCD_PROGRESS_BAR)
308
   #if ENABLED(LCD_PROGRESS_BAR)
464
 #if ENABLED(BABYSTEPPING)
487
 #if ENABLED(BABYSTEPPING)
465
 
488
 
466
   static void _lcd_babystep(int axis, const char* msg) {
489
   static void _lcd_babystep(int axis, const char* msg) {
490
+    ENCODER_DIRECTION_NORMAL(); 
467
     if (encoderPosition != 0) {
491
     if (encoderPosition != 0) {
468
       babystepsTodo[axis] += (BABYSTEP_MULTIPLICATOR) * (int)encoderPosition;
492
       babystepsTodo[axis] += (BABYSTEP_MULTIPLICATOR) * (int)encoderPosition;
469
       encoderPosition = 0;
493
       encoderPosition = 0;
828
 static void lcd_move_menu_axis();
852
 static void lcd_move_menu_axis();
829
 
853
 
830
 static void _lcd_move(const char* name, AxisEnum axis, int min, int max) {
854
 static void _lcd_move(const char* name, AxisEnum axis, int min, int max) {
855
+  ENCODER_DIRECTION_NORMAL(); 
831
   if ((encoderPosition != 0) && (movesplanned() <= 3)) {
856
   if ((encoderPosition != 0) && (movesplanned() <= 3)) {
832
     refresh_cmd_timeout();
857
     refresh_cmd_timeout();
833
     current_position[axis] += float((int)encoderPosition) * move_menu_scale;
858
     current_position[axis] += float((int)encoderPosition) * move_menu_scale;
855
     uint8_t e
880
     uint8_t e
856
   #endif
881
   #endif
857
 ) {
882
 ) {
883
+  ENCODER_DIRECTION_NORMAL(); 
858
   #if EXTRUDERS > 1
884
   #if EXTRUDERS > 1
859
     unsigned short original_active_extruder = active_extruder;
885
     unsigned short original_active_extruder = active_extruder;
860
     active_extruder = e;
886
     active_extruder = e;
1263
  */
1289
  */
1264
 #if ENABLED(HAS_LCD_CONTRAST)
1290
 #if ENABLED(HAS_LCD_CONTRAST)
1265
   static void lcd_set_contrast() {
1291
   static void lcd_set_contrast() {
1292
+    ENCODER_DIRECTION_NORMAL();
1266
     if (encoderPosition != 0) {
1293
     if (encoderPosition != 0) {
1267
       #if ENABLED(U8GLIB_LM6059_AF)
1294
       #if ENABLED(U8GLIB_LM6059_AF)
1268
         lcd_contrast += encoderPosition;
1295
         lcd_contrast += encoderPosition;
1331
    *
1358
    *
1332
    */
1359
    */
1333
   void lcd_sdcard_menu() {
1360
   void lcd_sdcard_menu() {
1361
+    ENCODER_DIRECTION_MENUS();
1334
     if (lcdDrawUpdate == 0 && LCD_CLICKED == 0) return; // nothing to do (so don't thrash the SD card)
1362
     if (lcdDrawUpdate == 0 && LCD_CLICKED == 0) return; // nothing to do (so don't thrash the SD card)
1335
     uint16_t fileCnt = card.getnrfilenames();
1363
     uint16_t fileCnt = card.getnrfilenames();
1336
     START_MENU();
1364
     START_MENU();
1371
  *
1399
  *
1372
  * Functions for editing single values
1400
  * Functions for editing single values
1373
  *
1401
  *
1402
+ * The "menu_edit_type" macro generates the functions needed to edit a numerical value.
1403
+ *
1404
+ * For example, menu_edit_type(int, int3, itostr3, 1) expands into these functions:
1405
+ *
1406
+ *   bool _menu_edit_int3();
1407
+ *   void menu_edit_int3(); // edit int (interactively)
1408
+ *   void menu_edit_callback_int3(); // edit int (interactively) with callback on completion
1409
+ *   static void _menu_action_setting_edit_int3(const char* pstr, int* ptr, int minValue, int maxValue);
1410
+ *   static void menu_action_setting_edit_int3(const char* pstr, int* ptr, int minValue, int maxValue);
1411
+ *   static void menu_action_setting_edit_callback_int3(const char* pstr, int* ptr, int minValue, int maxValue, menuFunc_t callback); // edit int with callback
1412
+ *
1413
+ * You can then use one of the menu macros to present the edit interface:
1414
+ *   MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_multiplier, 10, 999)
1415
+ *
1416
+ * This expands into a more primitive menu item:
1417
+ *   MENU_ITEM(setting_edit_int3, MSG_SPEED, PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999)
1418
+ *
1419
+ *
1420
+ * Also: MENU_MULTIPLIER_ITEM_EDIT, MENU_ITEM_EDIT_CALLBACK, and MENU_MULTIPLIER_ITEM_EDIT_CALLBACK
1421
+ *     
1422
+ *       menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999)
1374
  */
1423
  */
1375
 #define menu_edit_type(_type, _name, _strFunc, scale) \
1424
 #define menu_edit_type(_type, _name, _strFunc, scale) \
1376
   bool _menu_edit_ ## _name () { \
1425
   bool _menu_edit_ ## _name () { \
1426
+    ENCODER_DIRECTION_NORMAL(); \
1377
     bool isClicked = LCD_CLICKED; \
1427
     bool isClicked = LCD_CLICKED; \
1378
     if ((int32_t)encoderPosition < 0) encoderPosition = 0; \
1428
     if ((int32_t)encoderPosition < 0) encoderPosition = 0; \
1379
     if ((int32_t)encoderPosition > maxEditValue) encoderPosition = maxEditValue; \
1429
     if ((int32_t)encoderPosition > maxEditValue) encoderPosition = maxEditValue; \
1937
       buttons = ~newbutton; //invert it, because a pressed switch produces a logical 0
1987
       buttons = ~newbutton; //invert it, because a pressed switch produces a logical 0
1938
     #endif //!NEWPANEL
1988
     #endif //!NEWPANEL
1939
 
1989
 
1990
+    #if ENABLED(REVERSE_MENU_DIRECTION)
1991
+      #define ENCODER_DIFF_CW  (encoderDiff += encoderDirection)
1992
+      #define ENCODER_DIFF_CCW (encoderDiff -= encoderDirection)
1993
+    #else
1994
+      #define ENCODER_DIFF_CW  (encoderDiff++)
1995
+      #define ENCODER_DIFF_CCW (encoderDiff--)
1996
+    #endif
1997
+    #define ENCODER_SPIN(_E1, _E2) switch (lastEncoderBits) { case _E1: ENCODER_DIFF_CW; break; case _E2: ENCODER_DIFF_CCW; }
1998
+
1940
     //manage encoder rotation
1999
     //manage encoder rotation
1941
     uint8_t enc = 0;
2000
     uint8_t enc = 0;
1942
     if (buttons & EN_A) enc |= B01;
2001
     if (buttons & EN_A) enc |= B01;
1943
     if (buttons & EN_B) enc |= B10;
2002
     if (buttons & EN_B) enc |= B10;
1944
     if (enc != lastEncoderBits) {
2003
     if (enc != lastEncoderBits) {
1945
       switch (enc) {
2004
       switch (enc) {
1946
-        case encrot0:
1947
-          if (lastEncoderBits == encrot3) encoderDiff++;
1948
-          else if (lastEncoderBits == encrot1) encoderDiff--;
1949
-          break;
1950
-        case encrot1:
1951
-          if (lastEncoderBits == encrot0) encoderDiff++;
1952
-          else if (lastEncoderBits == encrot2) encoderDiff--;
1953
-          break;
1954
-        case encrot2:
1955
-          if (lastEncoderBits == encrot1) encoderDiff++;
1956
-          else if (lastEncoderBits == encrot3) encoderDiff--;
1957
-          break;
1958
-        case encrot3:
1959
-          if (lastEncoderBits == encrot2) encoderDiff++;
1960
-          else if (lastEncoderBits == encrot0) encoderDiff--;
1961
-          break;
2005
+        case encrot0: ENCODER_SPIN(encrot3, encrot1); break;
2006
+        case encrot1: ENCODER_SPIN(encrot0, encrot2); break;
2007
+        case encrot2: ENCODER_SPIN(encrot1, encrot3); break;
2008
+        case encrot3: ENCODER_SPIN(encrot2, encrot0); break;
1962
       }
2009
       }
1963
     }
2010
     }
1964
     lastEncoderBits = enc;
2011
     lastEncoderBits = enc;
2242
    *   - Click saves the Z and goes to the next mesh point
2289
    *   - Click saves the Z and goes to the next mesh point
2243
    */
2290
    */
2244
   static void _lcd_level_bed() {
2291
   static void _lcd_level_bed() {
2292
+    ENCODER_DIRECTION_NORMAL(); 
2245
     if ((encoderPosition != 0) && (movesplanned() <= 3)) {
2293
     if ((encoderPosition != 0) && (movesplanned() <= 3)) {
2246
       refresh_cmd_timeout();
2294
       refresh_cmd_timeout();
2247
       current_position[Z_AXIS] += float((int)encoderPosition) * (MBL_Z_STEP);
2295
       current_position[Z_AXIS] += float((int)encoderPosition) * (MBL_Z_STEP);

+ 2
- 0
Marlin/ultralcd.h Näytä tiedosto

54
 
54
 
55
   extern bool cancel_heatup;
55
   extern bool cancel_heatup;
56
 
56
 
57
+  extern uint8_t blink; // Variable for animation
58
+
57
   #if ENABLED(FILAMENT_LCD_DISPLAY)
59
   #if ENABLED(FILAMENT_LCD_DISPLAY)
58
     extern millis_t previous_lcd_status_ms;
60
     extern millis_t previous_lcd_status_ms;
59
   #endif
61
   #endif

+ 0
- 1
Marlin/ultralcd_implementation_hitachi_HD44780.h Näytä tiedosto

5
 * Implementation of the LCD display routines for a Hitachi HD44780 display. These are common LCD character displays.
5
 * Implementation of the LCD display routines for a Hitachi HD44780 display. These are common LCD character displays.
6
 **/
6
 **/
7
 
7
 
8
-static unsigned char blink = 0; // Variable for animation
9
 extern volatile uint8_t buttons;  //an extended version of the last checked buttons in a bit array.
8
 extern volatile uint8_t buttons;  //an extended version of the last checked buttons in a bit array.
10
 
9
 
11
 ////////////////////////////////////
10
 ////////////////////////////////////

Loading…
Peruuta
Tallenna