From f6a6cb1d6c75830fdfc23c7afb1b46e5c4fa1c9c Mon Sep 17 00:00:00 2001 From: shanggl Date: Sat, 5 Nov 2022 21:35:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4=EF=BC=8C?= =?UTF-8?q?=20=E4=BC=98=E5=8C=96=E5=86=85=E5=AE=B9=E6=9C=89=E7=94=A8?= =?UTF-8?q?=E4=BD=86=E6=98=AF=E5=B0=9A=E6=9C=AA=E8=A7=A3=E5=86=B3bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/drivers/bus_i2c_atbsp_init.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/drivers/bus_i2c_atbsp_init.c b/src/main/drivers/bus_i2c_atbsp_init.c index dce1291e3..aefd3f1a2 100644 --- a/src/main/drivers/bus_i2c_atbsp_init.c +++ b/src/main/drivers/bus_i2c_atbsp_init.c @@ -176,6 +176,10 @@ void i2cInit(I2CDevice device) i2c_own_address1_set( pHandle->i2cx, I2C_ADDRESS_MODE_7BIT, 0x0); + //开启时钟延展 + i2c_clock_stretch_enable(pHandle->i2cx,TRUE); + + nvic_irq_enable(hardware->er_irq, NVIC_PRIORITY_BASE(NVIC_PRIO_I2C_ER), NVIC_PRIORITY_SUB(NVIC_PRIO_I2C_ER)); nvic_irq_enable(hardware->ev_irq, NVIC_PRIORITY_BASE(NVIC_PRIO_I2C_EV), NVIC_PRIORITY_SUB(NVIC_PRIO_I2C_EV));