|
@@ -113,7 +113,7 @@ static void menu_action_setting_edit_callback_long5(const char* pstr, unsigned l
|
113
|
113
|
|
114
|
114
|
/** Used variables to keep track of the menu */
|
115
|
115
|
volatile uint8_t buttons;//Contains the bits of the currently pressed buttons.
|
116
|
|
-volatile uint8_t buttons_keypad; // to store the keypad shiftregister values
|
|
116
|
+volatile uint8_t buttons_reprapworld_keypad; // to store the reprapworld_keypad shiftregister values
|
117
|
117
|
|
118
|
118
|
uint8_t currentMenuViewOffset; /* scroll offset in the current menu */
|
119
|
119
|
uint32_t blocking_enc;
|
|
@@ -688,19 +688,18 @@ menu_edit_type(float, float51, ftostr51, 10)
|
688
|
688
|
menu_edit_type(float, float52, ftostr52, 100)
|
689
|
689
|
menu_edit_type(unsigned long, long5, ftostr5, 0.01)
|
690
|
690
|
|
691
|
|
-#ifdef KEYPAD
|
692
|
|
- static void keypad_move_y_down() {
|
693
|
|
- SERIAL_ECHO("keypad_move_y_down");
|
|
691
|
+#ifdef REPRAPWORLD_KEYPAD
|
|
692
|
+ static void reprapworld_keypad_move_y_down() {
|
694
|
693
|
encoderPosition = 1;
|
695
|
|
- move_menu_scale = KEYPAD_MOVE_STEP;
|
|
694
|
+ move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
|
696
|
695
|
lcd_move_y();
|
697
|
696
|
}
|
698
|
|
- static void keypad_move_y_up() {
|
|
697
|
+ static void reprapworld_keypad_move_y_up() {
|
699
|
698
|
encoderPosition = -1;
|
700
|
|
- move_menu_scale = KEYPAD_MOVE_STEP;
|
|
699
|
+ move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
|
701
|
700
|
lcd_move_y();
|
702
|
701
|
}
|
703
|
|
- static void keypad_move_home() {
|
|
702
|
+ static void reprapworld_keypad_move_home() {
|
704
|
703
|
//enquecommand_P((PSTR("G28"))); // move all axis home
|
705
|
704
|
// TODO gregor: move all axis home, i have currently only one axis on my prusa i3
|
706
|
705
|
enquecommand_P((PSTR("G28 Y")));
|
|
@@ -770,7 +769,7 @@ void lcd_init()
|
770
|
769
|
WRITE(BTN_EN1,HIGH);
|
771
|
770
|
WRITE(BTN_EN2,HIGH);
|
772
|
771
|
WRITE(BTN_ENC,HIGH);
|
773
|
|
- #ifdef KEYPAD
|
|
772
|
+ #ifdef REPRAPWORLD_KEYPAD
|
774
|
773
|
pinMode(SHIFT_CLK,OUTPUT);
|
775
|
774
|
pinMode(SHIFT_LD,OUTPUT);
|
776
|
775
|
pinMode(SHIFT_OUT,INPUT);
|
|
@@ -823,15 +822,15 @@ void lcd_update()
|
823
|
822
|
if (lcd_next_update_millis < millis())
|
824
|
823
|
{
|
825
|
824
|
#ifdef ULTIPANEL
|
826
|
|
- #ifdef KEYPAD
|
827
|
|
- if (KEYPAD_MOVE_Y_DOWN) {
|
828
|
|
- keypad_move_y_down();
|
|
825
|
+ #ifdef REPRAPWORLD_KEYPAD
|
|
826
|
+ if (REPRAPWORLD_KEYPAD_MOVE_Y_DOWN) {
|
|
827
|
+ reprapworld_keypad_move_y_down();
|
829
|
828
|
}
|
830
|
|
- if (KEYPAD_MOVE_Y_UP) {
|
831
|
|
- keypad_move_y_up();
|
|
829
|
+ if (REPRAPWORLD_KEYPAD_MOVE_Y_UP) {
|
|
830
|
+ reprapworld_keypad_move_y_up();
|
832
|
831
|
}
|
833
|
|
- if (KEYPAD_MOVE_HOME) {
|
834
|
|
- keypad_move_home();
|
|
832
|
+ if (REPRAPWORLD_KEYPAD_MOVE_HOME) {
|
|
833
|
+ reprapworld_keypad_move_home();
|
835
|
834
|
}
|
836
|
835
|
#endif
|
837
|
836
|
if (encoderDiff)
|
|
@@ -914,18 +913,20 @@ void lcd_buttons_update()
|
914
|
913
|
if((blocking_enc<millis()) && (READ(BTN_ENC)==0))
|
915
|
914
|
newbutton |= EN_C;
|
916
|
915
|
buttons = newbutton;
|
917
|
|
- // for the keypad
|
918
|
|
- uint8_t newbutton_keypad=0;
|
919
|
|
- WRITE(SHIFT_LD,LOW);
|
920
|
|
- WRITE(SHIFT_LD,HIGH);
|
921
|
|
- for(int8_t i=0;i<8;i++) {
|
922
|
|
- newbutton_keypad = newbutton_keypad>>1;
|
923
|
|
- if(READ(SHIFT_OUT))
|
924
|
|
- newbutton_keypad|=(1<<7);
|
925
|
|
- WRITE(SHIFT_CLK,HIGH);
|
926
|
|
- WRITE(SHIFT_CLK,LOW);
|
927
|
|
- }
|
928
|
|
- buttons_keypad=~newbutton_keypad; //invert it, because a pressed switch produces a logical 0
|
|
916
|
+ #ifdef REPRAPWORLD_KEYPAD
|
|
917
|
+ // for the reprapworld_keypad
|
|
918
|
+ uint8_t newbutton_reprapworld_keypad=0;
|
|
919
|
+ WRITE(SHIFT_LD,LOW);
|
|
920
|
+ WRITE(SHIFT_LD,HIGH);
|
|
921
|
+ for(int8_t i=0;i<8;i++) {
|
|
922
|
+ newbutton_reprapworld_keypad = newbutton_reprapworld_keypad>>1;
|
|
923
|
+ if(READ(SHIFT_OUT))
|
|
924
|
+ newbutton_reprapworld_keypad|=(1<<7);
|
|
925
|
+ WRITE(SHIFT_CLK,HIGH);
|
|
926
|
+ WRITE(SHIFT_CLK,LOW);
|
|
927
|
+ }
|
|
928
|
+ buttons_reprapworld_keypad=~newbutton_reprapworld_keypad; //invert it, because a pressed switch produces a logical 0
|
|
929
|
+ #endif
|
929
|
930
|
#else //read it from the shift register
|
930
|
931
|
uint8_t newbutton=0;
|
931
|
932
|
WRITE(SHIFT_LD,LOW);
|