diff --git a/src/gpio.c b/src/gpio.c index aae9b94..c97c57f 100644 --- a/src/gpio.c +++ b/src/gpio.c @@ -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; }