🩹 Use custom I2C pins for OLED (#24970)

This commit is contained in:
alextrical
2022-12-12 22:11:09 +00:00
committed by Scott Lahteine
parent ac05f0cb8b
commit 8bafc1d9ae
3 changed files with 18 additions and 34 deletions

View File

@ -173,6 +173,10 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
#endif
#if HAS_U8GLIB_I2C_OLED && PINS_EXIST(I2C_SCL, I2C_SDA) && DISABLED(SOFT_I2C_EEPROM)
#include "Wire.h"
#endif
// Encoder Handling
#if HAS_ENCODER_ACTION
uint32_t MarlinUI::encoderPosition;
@ -265,6 +269,10 @@ void MarlinUI::init() {
slow_buttons = 0;
#endif
#if HAS_U8GLIB_I2C_OLED && PINS_EXIST(I2C_SCL, I2C_SDA) && DISABLED(SOFT_I2C_EEPROM)
Wire.begin(int(I2C_SDA_PIN), int(I2C_SCL_PIN));
#endif
update_buttons();
TERN_(HAS_ENCODER_ACTION, encoderDiff = 0);