From acc3648afcd6b0c2c852f7650dd618d092549d0c Mon Sep 17 00:00:00 2001 From: 3djc Date: Tue, 17 Jun 2025 04:09:48 +0200 Subject: [PATCH] fix(gx12): use PCA95xx reset pin in case of read issues (#6358) --- radio/src/targets/taranis/gx12/bsp_io.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/radio/src/targets/taranis/gx12/bsp_io.cpp b/radio/src/targets/taranis/gx12/bsp_io.cpp index c254f1e78..4256093d3 100644 --- a/radio/src/targets/taranis/gx12/bsp_io.cpp +++ b/radio/src/targets/taranis/gx12/bsp_io.cpp @@ -24,6 +24,7 @@ #include "drivers/pca95xx.h" #include "stm32_i2c_driver.h" #include "timers_driver.h" +#include "delays_driver.h" #include "stm32_ws2812.h" #include "os/async.h" @@ -55,6 +56,11 @@ static uint32_t _read_io_expander(bsp_io_expander* io) uint16_t value = 0; if (pca95xx_read(&io->exp, io->mask, &value) == 0) { io->state = value; + } else { + gpio_clear(IO_RESET_GPIO); + TRACE("PCA95 was reset"); + delay_us(1); // Only 6ns are needed according to PCA datasheet, but lets be safe + gpio_set(IO_RESET_GPIO); } return io->state; }