Fix RAMPS + VIKI i2c (#15811)

This commit is contained in:
Axel 2019-11-06 19:52:28 -03:00 committed by Scott Lahteine
parent e6dfc991ae
commit 786617e375
4 changed files with 14 additions and 8 deletions

View File

@ -111,6 +111,12 @@ static void createChar_P(const char c, const byte * const ptr) {
#define LCD_STR_PROGRESS "\x03\x04\x05"
#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*/) {
#if NONE(LCD_PROGRESS_BAR, SHOW_BOOTSCREEN)
UNUSED(screen_charset);

View File

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

View File

@ -153,6 +153,8 @@
#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)
// button and encoder bit positions within 'buttons'

View File

@ -66,7 +66,7 @@
//
#ifndef SERVO0_PIN
#ifdef IS_RAMPS_13
#define SERVO0_PIN 7 // RAMPS_13 // Will conflict with BTN_EN2 on LCD_I2C_VIKI
#define SERVO0_PIN 7
#else
#define SERVO0_PIN 11
#endif
@ -531,8 +531,8 @@
#elif ENABLED(LCD_I2C_VIKI)
#define BTN_EN1 22 // 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_EN1 40 // http://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42.
#define BTN_EN2 42
#define BTN_ENC -1
#define LCD_SDSS SDSS