Merge branch 'bugfixed/i2ctools_example' into 'master'

i2c_tools: support i2ctools example on all chips

See merge request espressif/esp-idf!13246
This commit is contained in:
Michael (XIAO Xufeng)
2021-05-26 08:02:34 +00:00
2 changed files with 2 additions and 15 deletions

View File

@@ -1,6 +1,3 @@
| Supported Targets | ESP32 |
| ----------------- | ----- |
# I2C Tools Example # I2C Tools Example
(See the README.md file in the upper level 'examples' directory for more information about examples.) (See the README.md file in the upper level 'examples' directory for more information about examples.)
@@ -65,7 +62,7 @@ See the [Getting Started Guide](https://docs.espressif.com/projects/esp-idf/en/l
| | | |
============================================================== ==============================================================
esp32> help i2c-tools> help
help help
Print the list of registered commands Print the list of registered commands

View File

@@ -34,17 +34,7 @@ static esp_err_t i2c_get_port(int port, i2c_port_t *i2c_port)
ESP_LOGE(TAG, "Wrong port number: %d", port); ESP_LOGE(TAG, "Wrong port number: %d", port);
return ESP_FAIL; return ESP_FAIL;
} }
switch (port) { *i2c_port = port;
case 0:
*i2c_port = I2C_NUM_0;
break;
case 1:
*i2c_port = I2C_NUM_1;
break;
default:
*i2c_port = I2C_NUM_0;
break;
}
return ESP_OK; return ESP_OK;
} }