From 9322c408c68bc7c5edd88bf674f9f85fa0d2ffc5 Mon Sep 17 00:00:00 2001 From: Robert F-C Date: Sun, 24 Mar 2013 18:19:58 +1100 Subject: [PATCH] Updated for LiquidTWI2 library version 1.2.3 The new version of the library means that PANELOLU no longer needs to be defined in LiquidTWI.h (the library file can be used as is) and the new version of the library also enables the buzzer on the Panucatt VIKI panel. --- Marlin/Configuration.h | 14 ++++++++------ Marlin/Marlin.pde | 3 --- Marlin/ultralcd_implementation_hitachi_HD44780.h | 4 ++-- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index ba20c6c04..71f0ca455 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -348,11 +348,12 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th #define ULTIPANEL #endif -//PANELOLU2 LCD with status LEDs, separate encoder and click inputs +// PANELOLU2 LCD with status LEDs, separate encoder and click inputs //#define LCD_I2C_PANELOLU2 #ifdef LCD_I2C_PANELOLU2 - // This uses the LiquidTWI2 library ( https://github.com/lincomatic/LiquidTWI2 ) - // Make sure it is placed in the Arduino or Sketchbook libraries directory. + // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 ) + // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory. + // (v1.2.3 no longer requires you to define PANELOLU in the LiquidTWI2.h library header file) // Note: The PANELOLU2 encoder click input can either be directly connected to a pin // (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). #define LCD_I2C_TYPE_MCP23017 @@ -362,15 +363,16 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th #define ULTIPANEL #endif -//Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs +// Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs //#define LCD_I2C_VIKI #ifdef LCD_I2C_VIKI - // This uses the LiquidTWI2 library ( https://github.com/lincomatic/LiquidTWI2 ) - // Make sure it is placed in the Arduino or Sketchbook libraries directory. + // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 ) + // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory. // Note: The pause/stop/resume LCD button pin should be connected to the Arduino // BTN_ENC pin (or set BTN_ENC to -1 if not used) #define LCD_I2C_TYPE_MCP23017 #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander + #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later) #define NEWPANEL #define ULTIPANEL #endif diff --git a/Marlin/Marlin.pde b/Marlin/Marlin.pde index a3ebf4756..f7442feb7 100644 --- a/Marlin/Marlin.pde +++ b/Marlin/Marlin.pde @@ -40,9 +40,6 @@ #elif defined(LCD_I2C_TYPE_MCP23017) || defined(LCD_I2C_TYPE_MCP23008) #include #include - #if defined(LCD_I2C_PANELOLU2) && !defined(PANELOLU2) - #error You must uncomment "#define PANELOLU2" in LiquidTWI2.h for LiquidTWI2.cpp to compile correctly - #endif #else #include #endif diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index c5d1e26c2..845cc33df 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -54,11 +54,11 @@ extern volatile uint8_t buttons; //the last checked buttons in a bit array. #define LCD_HAS_SLOW_BUTTONS #elif defined(LCD_I2C_PANELOLU2) + // encoder click can be read through I2C if not directly connected #if !defined(BTN_ENC) || BTN_ENC == -1 - // encoder click is connected through I2C (rather than directly connected) #define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C) - #define B_MI (ENCODER_C<