ESP32-Console

This commit is contained in:
2025-01-17 20:07:29 -05:00
parent 2525ba9d14
commit ab93ad0341

View File

@@ -97,12 +97,10 @@ static int exec_gpio_reset_cmd(int argc, char **argv) {
Set the levelof specified GPIO HIGH or LOW
*/
// Check that the minimal required arguments were passed, i.e. pin #, mode, and logic level.
if (gpio_set_args.gpio->count > 0 && gpio_set_args.level->count > 0 && gpio_set_args.mode->count > 0) {
if (gpio_set_args.gpio->count > 0 && gpio_set_args.mode->count > 0) {
// Display brief summary of passed arguments.
ESP_LOGI("GPIO", "pin: %i, mode: %s, level: %i",
gpio_set_args.gpio->ival[0],
gpio_set_args.mode->sval[0],
gpio_set_args.level->ival[0]);
ESP_LOGI("gpio-reset", "pin to reset: %i",
gpio_set_args.gpio->ival[0]);
// Set the bit mask for the pin number that was passed
pin_config.pin_bit_mask = 1ULL << gpio_set_args.gpio->ival[0];
// Since we are setting the pin level, set the pin mode to OUTPUT