spi: suppress spi_bus_lock_touch log level

The log in the spi_bus_lock_touch may be annoying. This commit suppress 
the log level, and make the log visible only when the device altered.

Resolves https://github.com/espressif/esp-idf/issues/5056
This commit is contained in:
Michael (XIAO Xufeng) 2020-05-07 00:32:24 +08:00
parent a064e0c4de
commit e04bb43b9f

View file

@ -657,9 +657,10 @@ IRAM_ATTR bool spi_bus_lock_touch(spi_bus_lock_dev_handle_t dev_handle)
{
spi_bus_lock_dev_t* last_dev = dev_handle->parent->last_dev;
dev_handle->parent->last_dev = dev_handle;
if (last_dev) {
ESP_DRAM_LOGD(TAG, "SPI dev changed from %d to %d",
dev_lock_get_id(last_dev), dev_lock_get_id(dev_handle));
if (last_dev != dev_handle) {
int last_dev_id = (last_dev? dev_lock_get_id(last_dev): -1);
ESP_DRAM_LOGV(TAG, "SPI dev changed from %d to %d",
last_dev_id, dev_lock_get_id(dev_handle));
}
return (dev_handle != last_dev);
}