modem: hl7800: fix UART shutdown
Allow CTS line to determine UART shutdown for any sleep mode. This allows lower average current consumption for LITE HIBERNATE mode. Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
This commit is contained in:
parent
fb9b3bcd93
commit
ab9715031c
1 changed files with 8 additions and 10 deletions
|
@ -4698,8 +4698,6 @@ static void mdm_vgpio_work_cb(struct k_work *item)
|
||||||
ictx.desired_sleep_level == HL7800_SLEEP_LITE_HIBERNATE) {
|
ictx.desired_sleep_level == HL7800_SLEEP_LITE_HIBERNATE) {
|
||||||
if (ictx.sleep_state != ictx.desired_sleep_level) {
|
if (ictx.sleep_state != ictx.desired_sleep_level) {
|
||||||
set_sleep_state(ictx.desired_sleep_level);
|
set_sleep_state(ictx.desired_sleep_level);
|
||||||
} else {
|
|
||||||
LOG_WRN("Unexpected sleep condition");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ictx.iface && ictx.initialized && net_if_is_up(ictx.iface) &&
|
if (ictx.iface && ictx.initialized && net_if_is_up(ictx.iface) &&
|
||||||
|
@ -4842,15 +4840,15 @@ void mdm_uart_cts_callback(const struct device *port, struct gpio_callback *cb,
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_MODEM_HL7800_LOW_POWER_MODE
|
#ifdef CONFIG_MODEM_HL7800_LOW_POWER_MODE
|
||||||
if (ictx.desired_sleep_level == HL7800_SLEEP_SLEEP) {
|
if (ictx.cts_state) {
|
||||||
if (ictx.cts_state) {
|
/* HL7800 is not awake, shut down UART to save power */
|
||||||
/* HL7800 is not awake, shut down UART to save power */
|
if (ictx.allow_sleep) {
|
||||||
shutdown_uart();
|
shutdown_uart();
|
||||||
} else {
|
}
|
||||||
power_on_uart();
|
} else {
|
||||||
if (ictx.sleep_state == HL7800_SLEEP_SLEEP) {
|
power_on_uart();
|
||||||
allow_sleep(false);
|
if (ictx.sleep_state == HL7800_SLEEP_SLEEP) {
|
||||||
}
|
allow_sleep(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue