fix(pl18u): reinit I2C when touch screen not working (#7402)

This commit is contained in:
richardclli
2026-06-05 16:59:20 +10:00
committed by GitHub
parent 368fc288d3
commit e7291c45f4
2 changed files with 30 additions and 3 deletions
@@ -19,6 +19,8 @@
* GNU General Public License for more details.
*/
#include <cstring>
#include "stm32_i2c_driver.h"
#include "stm32_gpio.h"
#include "stm32_hal_ll.h"
@@ -546,7 +548,9 @@ int stm32_i2c_deinit(uint8_t bus)
if (!h) return -1;
if (HAL_I2C_DeInit(h) != HAL_OK) return -1;
memset(&h->Init, 0, sizeof(h->Init));
if (i2c_disable_clock(h->Instance) < 0) {
TRACE("I2C ERROR: HAL_I2C_MspDeInit() I2C misconfiguration");
return -1;