From d7e2e95435c41d47a65cc86342ea13bca4956187 Mon Sep 17 00:00:00 2001 From: ligenxxxx <59721724+ligenxxxx@users.noreply.github.com> Date: Tue, 6 Feb 2024 10:25:12 +0800 Subject: [PATCH] write() then wait(ms+2) --- src/i2c.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/i2c.c b/src/i2c.c index fb0c4777..f05e9e0d 100644 --- a/src/i2c.c +++ b/src/i2c.c @@ -121,9 +121,10 @@ uint8_t I2C_Write8(uint8_t slave_addr, uint8_t reg_addr, uint8_t val) { } uint8_t I2C_Write8_Wait(uint16_t ms, uint8_t slave_addr, uint8_t reg_addr, uint8_t val) { - WAIT(ms); - // debugf("\r\nEEP:0x%04x, 0x%04x", reg_addr, (uint16_t)val); - return I2C_Write8(slave_addr, reg_addr, val); + uint8_t ret; + ret = I2C_Write8(slave_addr, reg_addr, val); + WAIT(ms + 2); + return } uint8_t I2C_Write16(uint8_t slave_addr, uint16_t reg_addr, uint16_t val) {