Browse Source

Fix RAMPS + VIKI i2c (#15811)

pull/1/head
Axel 5 years ago
committed by Scott Lahteine
parent
commit
786617e375
  1. 6
      Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp
  2. 8
      Marlin/src/lcd/ultralcd.cpp
  3. 2
      Marlin/src/lcd/ultralcd.h
  4. 6
      Marlin/src/pins/ramps/pins_RAMPS.h

6
Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp

@ -111,6 +111,12 @@ static void createChar_P(const char c, const byte * const ptr) {
#define LCD_STR_PROGRESS "\x03\x04\x05" #define LCD_STR_PROGRESS "\x03\x04\x05"
#endif #endif
#if ENABLED(LCD_USE_I2C_BUZZER)
void MarlinUI::buzz(const long duration, const uint16_t freq) {
lcd.buzz(duration, freq);
}
#endif
void MarlinUI::set_custom_characters(const HD44780CharSet screen_charset/*=CHARSET_INFO*/) { void MarlinUI::set_custom_characters(const HD44780CharSet screen_charset/*=CHARSET_INFO*/) {
#if NONE(LCD_PROGRESS_BAR, SHOW_BOOTSCREEN) #if NONE(LCD_PROGRESS_BAR, SHOW_BOOTSCREEN)
UNUSED(screen_charset); UNUSED(screen_charset);

8
Marlin/src/lcd/ultralcd.cpp

@ -61,15 +61,13 @@
MarlinUI::progress_t MarlinUI::progress_override; // = 0 MarlinUI::progress_t MarlinUI::progress_override; // = 0
#endif #endif
#if HAS_BUZZER #if ENABLED(PCA9632_BUZZER) || USE_BEEPER
#include "../libs/buzzer.h" #include "../libs/buzzer.h" // for BUZZ() macro
#if ENABLED(PCA9632_BUZZER) #if ENABLED(PCA9632_BUZZER)
#include "../feature/leds/pca9632.h" #include "../feature/leds/pca9632.h"
#endif #endif
void MarlinUI::buzz(const long duration, const uint16_t freq) { void MarlinUI::buzz(const long duration, const uint16_t freq) {
#if ENABLED(LCD_USE_I2C_BUZZER) #if ENABLED(PCA9632_BUZZER)
lcd.buzz(duration, freq);
#elif ENABLED(PCA9632_BUZZER)
pca9632_buzz(duration, freq); pca9632_buzz(duration, freq);
#elif USE_BEEPER #elif USE_BEEPER
buzzer.tone(duration, freq); buzzer.tone(duration, freq);

2
Marlin/src/lcd/ultralcd.h

@ -153,6 +153,8 @@
#if ENABLED(LCD_I2C_VIKI) #if ENABLED(LCD_I2C_VIKI)
#include <LiquidTWI2.h>
#define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C) #define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C)
// button and encoder bit positions within 'buttons' // button and encoder bit positions within 'buttons'

6
Marlin/src/pins/ramps/pins_RAMPS.h

@ -66,7 +66,7 @@
// //
#ifndef SERVO0_PIN #ifndef SERVO0_PIN
#ifdef IS_RAMPS_13 #ifdef IS_RAMPS_13
#define SERVO0_PIN 7 // RAMPS_13 // Will conflict with BTN_EN2 on LCD_I2C_VIKI #define SERVO0_PIN 7
#else #else
#define SERVO0_PIN 11 #define SERVO0_PIN 11
#endif #endif
@ -531,8 +531,8 @@
#elif ENABLED(LCD_I2C_VIKI) #elif ENABLED(LCD_I2C_VIKI)
#define BTN_EN1 22 // http://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. #define BTN_EN1 40 // http://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42.
#define BTN_EN2 7 // 22/7 are unused on RAMPS_14. 22 is unused and 7 the SERVO0_PIN on RAMPS_13. #define BTN_EN2 42
#define BTN_ENC -1 #define BTN_ENC -1
#define LCD_SDSS SDSS #define LCD_SDSS SDSS

Loading…
Cancel
Save