diff --git a/components/platform_console/cmd_i2ctools.c b/components/platform_console/cmd_i2ctools.c index 30f97fba..70193751 100644 --- a/components/platform_console/cmd_i2ctools.c +++ b/components/platform_console/cmd_i2ctools.c @@ -1179,7 +1179,7 @@ cJSON * spiconfig_cb(){ static void register_spiconfig(void) { spiconfig_args.clear = arg_lit0(NULL, "clear", "Clear configuration"); - spiconfig_args.clk = arg_int0("k", "clock", "", "Clock GPIO"); + spiconfig_args.clk = arg_int0("k", "clk", "", "Clock GPIO"); spiconfig_args.data = arg_int0("d","data", "","Data GPIO"); spiconfig_args.dc = arg_int0("c","dc", "", "DC GPIO"); spiconfig_args.host= arg_int0("h", "host", "int", "SPI Host Number"); @@ -1198,7 +1198,7 @@ static void register_i2cconfig(void) { i2cconfig_args.clear = arg_lit0(NULL, "clear", "Clear configuration"); i2cconfig_args.port = arg_int0("p", "port", "0|1", "Port"); - i2cconfig_args.freq = arg_int0("f", "freq", "int", "Frequency (Hz) e.g. 100000"); + i2cconfig_args.freq = arg_int0("f", "speed", "int", "Frequency (Hz) e.g. 100000"); i2cconfig_args.sda = arg_int0("d", "sda", "", "SDA GPIO. e.g. 19"); i2cconfig_args.scl = arg_int0("c", "scl", "", "SCL GPIO. e.g. 18"); i2cconfig_args.load = arg_lit0("l", "load", "Load Existing Configuration"); diff --git a/components/services/accessors.c b/components/services/accessors.c index 475be28f..78274044 100644 --- a/components/services/accessors.c +++ b/components/services/accessors.c @@ -47,6 +47,7 @@ esp_err_t config_i2c_set(const i2c_config_t * config, int port){ } return ESP_OK; } + /**************************************************************************************** * */ @@ -259,32 +260,28 @@ esp_err_t get_gpio_structure(cJSON * gpio_entry, gpio_entry_t ** gpio){ cJSON * val = cJSON_GetObjectItem(gpio_entry,"gpio"); if(val){ (*gpio)->gpio= (int)val->valuedouble; - } - else { + } else { ESP_LOGE(TAG,"gpio pin not found"); err=ESP_FAIL; } val = cJSON_GetObjectItem(gpio_entry,"name"); if(val){ (*gpio)->name= strdup(cJSON_GetStringValue(val)); - } - else { + } else { ESP_LOGE(TAG,"gpio name value not found"); err=ESP_FAIL; } val = cJSON_GetObjectItem(gpio_entry,"group"); if(val){ (*gpio)->group= strdup(cJSON_GetStringValue(val)); - } - else { + } else { ESP_LOGE(TAG,"gpio group value not found"); err=ESP_FAIL; } val = cJSON_GetObjectItem(gpio_entry,"fixed"); if(val){ (*gpio)->fixed= cJSON_IsTrue(val); - } - else { + } else { ESP_LOGE(TAG,"gpio fixed indicator not found"); err=ESP_FAIL; } @@ -357,8 +354,7 @@ cJSON * get_gpio_list() { if (bat_config) { char *p; int channel; - if ((p = strcasestr(bat_config, "channel") ) != NULL) - { + if ((p = strcasestr(bat_config, "channel") ) != NULL) { channel = atoi(strchr(p, '=') + 1); if(channel != -1){ if(adc1_pad_get_io_num(channel,&gpio_num )==ESP_OK){