Merge pull request #2048 from Ralim/pinecilv2-i2c-rework
Drop critical section on I2C
This commit is contained in:
@@ -40,10 +40,7 @@ bool FRToSI2C::Mem_Read(uint16_t DevAddress, uint16_t read_address, uint8_t *p_b
|
|||||||
i2cCfg.data = p_buffer;
|
i2cCfg.data = p_buffer;
|
||||||
i2cCfg.subAddrSize = 1; // one byte address
|
i2cCfg.subAddrSize = 1; // one byte address
|
||||||
|
|
||||||
taskENTER_CRITICAL();
|
|
||||||
/* --------------- */
|
|
||||||
err = I2C_MasterReceiveBlocking(I2C0_ID, &i2cCfg);
|
err = I2C_MasterReceiveBlocking(I2C0_ID, &i2cCfg);
|
||||||
taskEXIT_CRITICAL();
|
|
||||||
bool res = err == SUCCESS;
|
bool res = err == SUCCESS;
|
||||||
if (!res) {
|
if (!res) {
|
||||||
I2C_Unstick();
|
I2C_Unstick();
|
||||||
@@ -65,10 +62,7 @@ bool FRToSI2C::Mem_Write(uint16_t DevAddress, uint16_t MemAddress, uint8_t *p_bu
|
|||||||
i2cCfg.data = p_buffer;
|
i2cCfg.data = p_buffer;
|
||||||
i2cCfg.subAddrSize = 1; // one byte address
|
i2cCfg.subAddrSize = 1; // one byte address
|
||||||
|
|
||||||
taskENTER_CRITICAL();
|
|
||||||
/* --------------- */
|
|
||||||
err = I2C_MasterSendBlocking(I2C0_ID, &i2cCfg);
|
err = I2C_MasterSendBlocking(I2C0_ID, &i2cCfg);
|
||||||
taskEXIT_CRITICAL();
|
|
||||||
bool res = err == SUCCESS;
|
bool res = err == SUCCESS;
|
||||||
if (!res) {
|
if (!res) {
|
||||||
I2C_Unstick();
|
I2C_Unstick();
|
||||||
|
|||||||
@@ -39,8 +39,6 @@ bool checkExitSoldering(void) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// If we have tripped thermal runaway, turn off heater and show warning
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user