Skip to content

Commit 011a2da

Browse files
committed
refactor(libraries/Wire): remove unused variables
Compiler reports "Wire.cpp:337:15: error: variable 'err' set but not used [-Werror=unused-but-set-variable]".
1 parent 7a351dd commit 011a2da

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

libraries/Wire/src/Wire.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,6 @@ bool TwoWire::begin(int sdaPin, int sclPin, uint32_t frequency)
334334

335335
void TwoWire::end()
336336
{
337-
esp_err_t err = ESP_OK;
338337
#if !CONFIG_DISABLE_HAL_LOCKS
339338
if(lock != NULL){
340339
//acquire lock
@@ -345,14 +344,14 @@ void TwoWire::end()
345344
#endif
346345
#if SOC_I2C_SUPPORT_SLAVE
347346
if(is_slave){
348-
err = i2cSlaveDeinit(num);
347+
esp_err_t err = i2cSlaveDeinit(num);
349348
if(err == ESP_OK){
350349
is_slave = false;
351350
}
352351
} else
353352
#endif /* SOC_I2C_SUPPORT_SLAVE */
354353
if(i2cIsInit(num)){
355-
err = i2cDeinit(num);
354+
i2cDeinit(num);
356355
}
357356
freeWireBuffer();
358357
#if !CONFIG_DISABLE_HAL_LOCKS

0 commit comments

Comments
 (0)