From 363fd8ab9800d46baec949c2baa6271df5e6dccc Mon Sep 17 00:00:00 2001 From: mverch67 Date: Fri, 27 Sep 2024 15:14:22 +0200 Subject: [PATCH] fix GPIO0 mode after I2S audio --- src/modules/ExternalNotificationModule.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/modules/ExternalNotificationModule.cpp b/src/modules/ExternalNotificationModule.cpp index 8abc386ec..2306119b1 100644 --- a/src/modules/ExternalNotificationModule.cpp +++ b/src/modules/ExternalNotificationModule.cpp @@ -98,6 +98,13 @@ int32_t ExternalNotificationModule::runOnce() LOG_INFO("%d ", i); } LOG_INFO("\n"); +#ifdef HAS_I2S + // GPIO0 is used as mclk for I2S audio and set to OUTPUT by the sound library + // T-Deck uses GPIO0 as trackball button, so restore the mode +#if defined(T_DECK) || (defined(BUTTON_PIN) && BUTTON_PIN == 0) + pinMode(0, INPUT); +#endif +#endif isNagging = false; return INT32_MAX; // save cycles till we're needed again }