Browse Source

Fix RAMPS + VIKI i2c (#15811)

Axel 4 years ago
parent
commit
786617e375

+ 6
- 0
Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp View File

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

+ 3
- 5
Marlin/src/lcd/ultralcd.cpp View File

@@ -61,15 +61,13 @@
61 61
   MarlinUI::progress_t MarlinUI::progress_override; // = 0
62 62
 #endif
63 63
 
64
-#if HAS_BUZZER
65
-  #include "../libs/buzzer.h"
64
+#if ENABLED(PCA9632_BUZZER) || USE_BEEPER
65
+  #include "../libs/buzzer.h" // for BUZZ() macro
66 66
   #if ENABLED(PCA9632_BUZZER)
67 67
     #include "../feature/leds/pca9632.h"
68 68
   #endif
69 69
   void MarlinUI::buzz(const long duration, const uint16_t freq) {
70
-    #if ENABLED(LCD_USE_I2C_BUZZER)
71
-      lcd.buzz(duration, freq);
72
-    #elif ENABLED(PCA9632_BUZZER)
70
+    #if ENABLED(PCA9632_BUZZER)
73 71
       pca9632_buzz(duration, freq);
74 72
     #elif USE_BEEPER
75 73
       buzzer.tone(duration, freq);

+ 2
- 0
Marlin/src/lcd/ultralcd.h View File

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

+ 3
- 3
Marlin/src/pins/ramps/pins_RAMPS.h View File

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

Loading…
Cancel
Save