Merge pull request #1551 from thinkyhead/redundant_encrot

Cleanup rotary encoder encrot* defines
This commit is contained in:
Scott Lahteine 2015-03-04 03:22:24 -08:00
commit d052a3c6aa
10 changed files with 18 additions and 69 deletions

View File

@ -21,17 +21,13 @@
**/
#ifdef ULTIPANEL
#define BLEN_A 0
#define BLEN_B 1
#define BLEN_C 2
#define EN_A (1<<BLEN_A)
#define EN_B (1<<BLEN_B)
#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 BLEN_A 0
#define BLEN_B 1
#define BLEN_C 2
#define EN_A (1<<BLEN_A)
#define EN_B (1<<BLEN_B)
#define EN_C (1<<BLEN_C)
#define LCD_CLICKED (buttons&EN_C)
#endif
#include <U8glib.h>

View File

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

View File

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

View File

@ -83,10 +83,4 @@
#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

View File

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

View File

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

View File

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

View File

@ -116,11 +116,6 @@
#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
//arduino pin witch triggers an piezzo beeper
#define BEEPER 33 No Beeper added
@ -138,12 +133,6 @@
#define LCD_PINS_D6 27
#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:
// left up center down right red
#define BL_LE 7

View File

@ -1394,6 +1394,17 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
#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 */
void lcd_buttons_update() {
#ifdef NEWPANEL

View File

@ -123,17 +123,6 @@
#define LCD_CLICKED (buttons&(B_MI|B_ST))
#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
////////////////////////////////////