Cleanup rotary encoder encrot* defines

The encrot values are used in only one place, and don’t vary, so remove
redundant references.
master
Scott Lahteine 10 years ago
parent b869476e99
commit f379edca78

@ -27,10 +27,6 @@
#define EN_A (1<<BLEN_A) #define EN_A (1<<BLEN_A)
#define EN_B (1<<BLEN_B) #define EN_B (1<<BLEN_B)
#define EN_C (1<<BLEN_C) #define EN_C (1<<BLEN_C)
#define encrot0 0
#define encrot1 2
#define encrot2 3
#define encrot3 1
#define LCD_CLICKED (buttons&EN_C) #define LCD_CLICKED (buttons&EN_C)
#endif #endif

@ -87,9 +87,3 @@
// Cheaptronic v1.0 does not use this port // Cheaptronic v1.0 does not use this port
#define SDCARDDETECT -1 #define SDCARDDETECT -1
// Encoder rotation values
#define encrot0 0
#define encrot1 2
#define encrot2 3
#define encrot3 1

@ -74,12 +74,6 @@
#define BLEN_B 1 #define BLEN_B 1
#define BLEN_A 0 #define BLEN_A 0
//encoder rotation values
#define encrot0 0
#define encrot1 2
#define encrot2 3
#define encrot3 1
#endif // RA_CONTROL_PANEL #endif // RA_CONTROL_PANEL
#ifdef RA_DISCO #ifdef RA_DISCO

@ -83,10 +83,4 @@
#define SDCARDDETECT -1 // Ramps does not use this port #define SDCARDDETECT -1 // Ramps does not use this port
//encoder rotation values
#define encrot0 0
#define encrot1 2
#define encrot2 3
#define encrot3 1
#endif // ULTRA_LCD && NEWPANEL #endif // ULTRA_LCD && NEWPANEL

@ -80,9 +80,3 @@
#define BLEN_A 0 #define BLEN_A 0
#define SDCARDDETECT -1 // Megatronics does not use this port #define SDCARDDETECT -1 // Megatronics does not use this port
// Encoder rotation values
#define encrot0 0
#define encrot1 2
#define encrot2 3
#define encrot3 1

@ -95,9 +95,3 @@
#define BLEN_A 0 #define BLEN_A 0
#define SDCARDDETECT -1 // Megatronics does not use this port #define SDCARDDETECT -1 // Megatronics does not use this port
// Encoder rotation values
#define encrot0 0
#define encrot1 2
#define encrot2 3
#define encrot3 1

@ -95,9 +95,3 @@
#define BLEN_A 0 #define BLEN_A 0
#define SDCARDDETECT -1 // Megatronics does not use this port #define SDCARDDETECT -1 // Megatronics does not use this port
// Encoder rotation values
#define encrot0 0
#define encrot1 2
#define encrot2 3
#define encrot3 1

@ -116,11 +116,6 @@
#define SDCARDDETECT 81 // Ramps does not use this port #define SDCARDDETECT 81 // Ramps does not use this port
//encoder rotation values
#define encrot0 0
#define encrot1 2
#define encrot2 3
#define encrot3 1
#else //!NEWPANEL - old style panel with shift register #else //!NEWPANEL - old style panel with shift register
//arduino pin witch triggers an piezzo beeper //arduino pin witch triggers an piezzo beeper
#define BEEPER 33 No Beeper added #define BEEPER 33 No Beeper added
@ -138,12 +133,6 @@
#define LCD_PINS_D6 27 #define LCD_PINS_D6 27
#define LCD_PINS_D7 29 #define LCD_PINS_D7 29
//encoder rotation values
#define encrot0 0
#define encrot1 2
#define encrot2 3
#define encrot3 1
//bits in the shift register that carry the buttons for: //bits in the shift register that carry the buttons for:
// left up center down right red // left up center down right red
#define BL_LE 7 #define BL_LE 7

@ -1394,6 +1394,17 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
#ifdef ULTIPANEL #ifdef ULTIPANEL
////////////////////////
// Setup Rotary Encoder Bit Values (for two pin encoders to indicate movement)
// These values are independent of which pins are used for EN_A and EN_B indications
// The rotary encoder part is also independent to the chipset used for the LCD
#if defined(EN_A) && defined(EN_B)
#define encrot0 0
#define encrot1 2
#define encrot2 3
#define encrot3 1
#endif
/* Warning: This function is called from interrupt context */ /* Warning: This function is called from interrupt context */
void lcd_buttons_update() { void lcd_buttons_update() {
#ifdef NEWPANEL #ifdef NEWPANEL

@ -123,17 +123,6 @@
#define LCD_CLICKED (buttons&(B_MI|B_ST)) #define LCD_CLICKED (buttons&(B_MI|B_ST))
#endif #endif
////////////////////////
// Setup Rotary Encoder Bit Values (for two pin encoders to indicate movement)
// These values are independent of which pins are used for EN_A and EN_B indications
// The rotary encoder part is also independent to the chipset used for the LCD
#if defined(EN_A) && defined(EN_B)
#define encrot0 0
#define encrot1 2
#define encrot2 3
#define encrot3 1
#endif
#endif //ULTIPANEL #endif //ULTIPANEL
//////////////////////////////////// ////////////////////////////////////

Loading…
Cancel
Save