Skip to content

Commit

Permalink
drivers: wifi: esp: Fix wifi-reset-gpios handling
Browse files Browse the repository at this point in the history
wifi-reset-gpios is currently ignored after conversion to DT_INST
macros. Use wifi_reset_gpios instead of reset_gpios to fix the problem.

Fixes: a464ae7 ("drivers: wifi: esp: Convert to new DT_INST
  macros")
Signed-off-by: Marcin Niestroj <[email protected]>
  • Loading branch information
mniestroj authored and galak committed Apr 6, 2020
1 parent 8bd676e commit 91fe653
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/wifi/esp/esp.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ LOG_MODULE_REGISTER(wifi_esp);

/* pin settings */
enum modem_control_pins {
#if DT_INST_NODE_HAS_PROP(0, reset_gpios)
#if DT_INST_NODE_HAS_PROP(0, wifi_reset_gpios)
WIFI_RESET,
#endif
NUM_PINS,
};

static struct modem_pin modem_pins[] = {
#if DT_INST_NODE_HAS_PROP(0, reset_gpios)
MODEM_PIN(DT_INST_GPIO_LABEL(0, reset_gpios),
DT_INST_GPIO_PIN(0, reset_gpios),
#if DT_INST_NODE_HAS_PROP(0, wifi_reset_gpios)
MODEM_PIN(DT_INST_GPIO_LABEL(0, wifi_reset_gpios),
DT_INST_GPIO_PIN(0, wifi_reset_gpios),
GPIO_OUTPUT),
#endif
};
Expand Down Expand Up @@ -744,7 +744,7 @@ static void esp_reset(struct esp_data *dev)
net_if_down(dev->net_iface);
}

#if DT_INST_NODE_HAS_PROP(0, reset_gpios)
#if DT_INST_NODE_HAS_PROP(0, wifi_reset_gpios)
modem_pin_write(&dev->mctx, WIFI_RESET, 0);
k_sleep(K_MSEC(100));
modem_pin_write(&dev->mctx, WIFI_RESET, 1);
Expand Down

0 comments on commit 91fe653

Please sign in to comment.