Skip to content

Commit 28bc197

Browse files
authored
🐛 Put I2C init ahead of LCD init (#26409)
1 parent a8cb89b commit 28bc197

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Marlin/src/lcd/marlinui.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
218218

219219
void MarlinUI::init() {
220220

221+
#if HAS_U8GLIB_I2C_OLED && PINS_EXIST(I2C_SCL, I2C_SDA) && DISABLED(SOFT_I2C_EEPROM)
222+
Wire.begin(uint8_t(I2C_SDA_PIN), uint8_t(I2C_SCL_PIN));
223+
#endif
224+
221225
init_lcd();
222226

223227
#if HAS_DIGITAL_BUTTONS
@@ -274,10 +278,6 @@ void MarlinUI::init() {
274278
slow_buttons = 0;
275279
#endif
276280

277-
#if HAS_U8GLIB_I2C_OLED && PINS_EXIST(I2C_SCL, I2C_SDA) && DISABLED(SOFT_I2C_EEPROM)
278-
Wire.begin(int(I2C_SDA_PIN), int(I2C_SCL_PIN));
279-
#endif
280-
281281
update_buttons();
282282

283283
TERN_(HAS_ENCODER_ACTION, encoderDiff = 0);

0 commit comments

Comments
 (0)