Skip to content

Commit 995858c

Browse files
committed
fix(openthread): check state for ot wake
1 parent 3f5a6e9 commit 995858c

File tree

3 files changed

+5
-19
lines changed

3 files changed

+5
-19
lines changed

components/openthread/private_include/esp_openthread_sleep.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -25,16 +25,10 @@ extern "C" {
2525
esp_err_t esp_openthread_sleep_init(void);
2626

2727
/**
28-
* @brief This function performs the OpenThread sleep process.
28+
* @brief This function performs the OpenThread sleep and wake process.
2929
*
3030
*/
3131
void esp_openthread_sleep_process(void);
32-
33-
/**
34-
* @brief This function performs the OpenThread wakeup process.
35-
*
36-
*/
37-
void esp_openthread_wakeup_process(void);
3832
#endif
3933

4034
#ifdef __cplusplus

components/openthread/src/esp_openthread.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -187,9 +187,6 @@ esp_err_t esp_openthread_launch_mainloop(void)
187187
if (select(mainloop.max_fd + 1, &mainloop.read_fds, &mainloop.write_fds, &mainloop.error_fds,
188188
&mainloop.timeout) >= 0) {
189189
esp_openthread_lock_acquire(portMAX_DELAY);
190-
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE && CONFIG_OPENTHREAD_RADIO_NATIVE
191-
esp_openthread_wakeup_process();
192-
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE && CONFIG_OPENTHREAD_RADIO_NATIVE */
193190
error = esp_openthread_platform_process(instance, &mainloop);
194191
while (otTaskletsArePending(instance)) {
195192
otTaskletsProcess(instance);

components/openthread/src/port/esp_openthread_sleep.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -37,12 +37,7 @@ void esp_openthread_sleep_process(void)
3737
if (s_ot_sleep == false && esp_ieee802154_get_state() == ESP_IEEE802154_RADIO_SLEEP) {
3838
esp_pm_lock_release(s_pm_lock);
3939
s_ot_sleep = true;
40-
}
41-
}
42-
43-
void esp_openthread_wakeup_process(void)
44-
{
45-
if (s_ot_sleep) {
40+
} else if (s_ot_sleep && esp_ieee802154_get_state() != ESP_IEEE802154_RADIO_SLEEP) {
4641
esp_pm_lock_acquire(s_pm_lock);
4742
s_ot_sleep = false;
4843
}

0 commit comments

Comments
 (0)