mirror of
https://gitlab.com/mobian1/eg25-manager.git
synced 2025-08-29 15:22:20 +02:00
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:
10
src/gpio.c
10
src/gpio.c
@@ -71,12 +71,14 @@ int gpio_sequence_resume(struct EG25Manager *manager)
|
|||||||
|
|
||||||
int gpio_sequence_wake(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 */
|
/* Give the modem 200ms to wake from soft sleep */
|
||||||
usleep(200000);
|
usleep(200000);
|
||||||
|
|
||||||
g_message("Executed soft wake sequence");
|
g_message("Executed soft wake sequence");
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user