From be1536b82f21d2216f40444fdf5f43aa42823bf1 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Sat, 11 Jan 2025 12:50:17 +1100 Subject: [PATCH] Update I2C_Wrapper.cpp --- source/Core/BSP/Pinecilv2/I2C_Wrapper.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/Core/BSP/Pinecilv2/I2C_Wrapper.cpp b/source/Core/BSP/Pinecilv2/I2C_Wrapper.cpp index 93d11ae5..af5efbf7 100644 --- a/source/Core/BSP/Pinecilv2/I2C_Wrapper.cpp +++ b/source/Core/BSP/Pinecilv2/I2C_Wrapper.cpp @@ -40,10 +40,10 @@ bool FRToSI2C::Mem_Read(uint16_t DevAddress, uint16_t read_address, uint8_t *p_b i2cCfg.data = p_buffer; i2cCfg.subAddrSize = 1; // one byte address - taskENTER_CRITICAL(); + vTaskSuspendAll(); /* --------------- */ err = I2C_MasterReceiveBlocking(I2C0_ID, &i2cCfg); - taskEXIT_CRITICAL(); + xTaskResumeAll(); bool res = err == SUCCESS; if (!res) { I2C_Unstick(); @@ -65,10 +65,10 @@ bool FRToSI2C::Mem_Write(uint16_t DevAddress, uint16_t MemAddress, uint8_t *p_bu i2cCfg.data = p_buffer; i2cCfg.subAddrSize = 1; // one byte address - taskENTER_CRITICAL(); + vTaskSuspendAll(); /* --------------- */ err = I2C_MasterSendBlocking(I2C0_ID, &i2cCfg); - taskEXIT_CRITICAL(); + xTaskResumeAll(); bool res = err == SUCCESS; if (!res) { I2C_Unstick();