8000 solve missing return code error · stoph/arduino-esp32@123d257 · GitHub
[go: up one dir, main page]

Skip to content

Commit 123d257

Browse files
authored
solve missing return code error
i2cFreeQueue() was not explicitly returning a result, this cause -Werror flag to abort compilation. As noted by @PhilColbert
1 parent d4416bc commit 123d257

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cores/esp32/esp32-hal-i2c.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,15 @@ else {//not found
143143
}
144144

145145
i2c_err_t i2cFreeQueue(i2c_t * i2c){
146+
i2c_err_t rc=I2C_ERROR_OK;
146147
if(i2c->dq!=NULL){
147148
// what about EventHandle?
148149
free(i2c->dq);
149150
i2c->dq = NULL;
150151
}
151152
i2c->queueCount=0;
152153
i2c->queuePos=0;
154+
return rc;
153155
}
154156

155157
i2c_err_t i2cAddQueueWrite(i2c_t * i2c, uint16_t i2cDeviceAddr, uint8_t *dataPtr, uint16_t dataLen,bool sendStop,EventGroupHandle_t event){
@@ -1667,4 +1669,4 @@ if(i2c->intr_handle){
16671669
i2c->intr_handle=NULL;
16681670
}
16691671
return I2C_ERROR_OK;
1670-
}
1672+
}

0 commit comments

Comments
 (0)
0