Browse Source

Fix RAMPS + VIKI i2c (#15811)

Axel 5 years ago
parent
commit
786617e375

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

111
   #define LCD_STR_PROGRESS  "\x03\x04\x05"
111
   #define LCD_STR_PROGRESS  "\x03\x04\x05"
112
 #endif
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
 void MarlinUI::set_custom_characters(const HD44780CharSet screen_charset/*=CHARSET_INFO*/) {
120
 void MarlinUI::set_custom_characters(const HD44780CharSet screen_charset/*=CHARSET_INFO*/) {
115
   #if NONE(LCD_PROGRESS_BAR, SHOW_BOOTSCREEN)
121
   #if NONE(LCD_PROGRESS_BAR, SHOW_BOOTSCREEN)
116
     UNUSED(screen_charset);
122
     UNUSED(screen_charset);

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

61
   MarlinUI::progress_t MarlinUI::progress_override; // = 0
61
   MarlinUI::progress_t MarlinUI::progress_override; // = 0
62
 #endif
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
   #if ENABLED(PCA9632_BUZZER)
66
   #if ENABLED(PCA9632_BUZZER)
67
     #include "../feature/leds/pca9632.h"
67
     #include "../feature/leds/pca9632.h"
68
   #endif
68
   #endif
69
   void MarlinUI::buzz(const long duration, const uint16_t freq) {
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
       pca9632_buzz(duration, freq);
71
       pca9632_buzz(duration, freq);
74
     #elif USE_BEEPER
72
     #elif USE_BEEPER
75
       buzzer.tone(duration, freq);
73
       buzzer.tone(duration, freq);

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

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

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

66
 //
66
 //
67
 #ifndef SERVO0_PIN
67
 #ifndef SERVO0_PIN
68
   #ifdef IS_RAMPS_13
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
   #else
70
   #else
71
     #define SERVO0_PIN     11
71
     #define SERVO0_PIN     11
72
   #endif
72
   #endif
531
 
531
 
532
     #elif ENABLED(LCD_I2C_VIKI)
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
       #define BTN_ENC           -1
536
       #define BTN_ENC           -1
537
 
537
 
538
       #define LCD_SDSS          SDSS
538
       #define LCD_SDSS          SDSS

Loading…
Cancel
Save