gpio: don't execute soft wake sequence if already woken up

This add an unnecessary 200ms delay and pollute logs.
This commit is contained in:
Arnaud Ferraris
2021-10-05 11:23:06 +02:00
parent 8ae79fa34c
commit fcf3832f52

View File

@@ -71,12 +71,14 @@ int gpio_sequence_resume(struct EG25Manager *manager)
int gpio_sequence_wake(struct EG25Manager *manager)
{
gpiod_line_set_value(manager->gpio_out[GPIO_OUT_DTR], 0);
if (gpiod_line_get_value(manager->gpio_out[GPIO_OUT_DTR])) {
gpiod_line_set_value(manager->gpio_out[GPIO_OUT_DTR], 0);
/* Give the modem 200ms to wake from soft sleep */
usleep(200000);
/* Give the modem 200ms to wake from soft sleep */
usleep(200000);
g_message("Executed soft wake sequence");
g_message("Executed soft wake sequence");
}
return 0;
}