Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit 89b5292

Browse files
committed
lte_disconnect(): wait less
instead of first delaying 300ms and then testing whether the modem is ready (AT), do the test first and delay afterwards if needed in normal situations this will save 300ms, otherwise it won't make a difference
1 parent 3764541 commit 89b5292

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

esp32/mods/modlte.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1189,10 +1189,10 @@ STATIC mp_obj_t lte_disconnect(mp_obj_t self_in) {
11891189
lteppp_set_state(E_LTE_ATTACHED);
11901190
lte_push_at_command("ATH", LTE_RX_TIMEOUT_MAX_MS);
11911191
while (true) {
1192-
mp_hal_delay_ms(LTE_RX_TIMEOUT_MIN_MS);
11931192
if (lte_push_at_command("AT", LTE_RX_TIMEOUT_MAX_MS)) {
11941193
break;
11951194
}
1195+
mp_hal_delay_ms(LTE_RX_TIMEOUT_MIN_MS);
11961196
}
11971197
lte_check_attached(lte_legacyattach_flag);
11981198
mod_network_deregister_nic(&lte_obj);

0 commit comments

Comments
 (0)