Fix RAMPS + VIKI i2c (#15811)
This commit is contained in:
parent
e6dfc991ae
commit
786617e375
4 changed files with 14 additions and 8 deletions
|
@ -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);
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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'
|
||||||
|
|
|
@ -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
|
||||||
|
|
Reference in a new issue