Skip to content

Commit 7a351dd

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

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

libraries/Wire/src/Wire.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,6 @@ uint32_t TwoWire::getClock()
390390

391391
void TwoWire::setClock(uint32_t frequency)
392392
{
393-
esp_err_t err = ESP_OK;
394393
#if !CONFIG_DISABLE_HAL_LOCKS
395394
//acquire lock
396395
if(lock == NULL || xSemaphoreTake(lock, portMAX_DELAY) != pdTRUE){
@@ -401,11 +400,10 @@ void TwoWire::setClock(uint32_t frequency)
401400
#if SOC_I2C_SUPPORT_SLAVE
402401
if(is_slave){
403402
log_e("Bus is in Slave Mode");
404-
err = ESP_FAIL;
405403
} else
406404
#endif /* SOC_I2C_SUPPORT_SLAVE */
407405
{
408-
err = i2cSetClock(num, frequency);
406+
i2cSetClock(num, frequency);
409407
}
410408
#if !CONFIG_DISABLE_HAL_LOCKS
411409
//release lock

0 commit comments

Comments
 (0)