kopia lustrzana https://github.com/espressif/esp-idf
ieee802154: exclude sleep file when do not define CONFIG_FREERTOS_USE_TICKLESS_IDLE
rodzic
45f5d54a60
commit
c7ab495b0b
|
@ -74,7 +74,6 @@ menu "IEEE 802.15.4"
|
|||
Enabling this option increases throughput by ~5% at the expense of ~2.1k
|
||||
IRAM code size increase.
|
||||
|
||||
|
||||
config IEEE802154_SLEEP_ENABLE
|
||||
# Todo: Remove when support safe power-down of the power domain (IDF-7317)
|
||||
bool "Enable IEEE802154 light sleep"
|
||||
|
|
|
@ -609,7 +609,7 @@ esp_err_t ieee802154_mac_init(void)
|
|||
ret = esp_intr_alloc(ieee802154_periph.irq_id, 0, ieee802154_isr, NULL, NULL);
|
||||
ESP_RETURN_ON_FALSE(ret == ESP_OK, ESP_FAIL, IEEE802154_TAG, "IEEE802154 MAC init failed");
|
||||
|
||||
ret = ieee802154_sleep_init();
|
||||
ESP_RETURN_ON_FALSE(ieee802154_sleep_init() == ESP_OK, ESP_FAIL, IEEE802154_TAG, "IEEE802154 MAC sleep init failed");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -740,7 +740,6 @@ static esp_err_t ieee802154_sleep_init(void)
|
|||
const static sleep_retention_entries_config_t ieee802154_mac_regs_retention[] = {
|
||||
[0] = { .config = REGDMA_LINK_CONTINUOUS_INIT(REGDMA_MODEM_IEEE802154_LINK(0x00), IEEE802154_REG_BASE, IEEE802154_REG_BASE, N_REGS_IEEE802154(), 0, 0), .owner = ENTRY(3) },
|
||||
};
|
||||
|
||||
err = sleep_retention_entries_create(ieee802154_mac_regs_retention, ARRAY_SIZE(ieee802154_mac_regs_retention), REGDMA_LINK_PRI_7, SLEEP_RETENTION_MODULE_802154_MAC);
|
||||
ESP_RETURN_ON_ERROR(err, IEEE802154_TAG, "failed to allocate memory for ieee802154 mac retention");
|
||||
ESP_LOGI(IEEE802154_TAG, "ieee802154 mac sleep retention initialization");
|
||||
|
|
|
@ -114,7 +114,6 @@ esp_err_t esp_ieee802154_sleep(void);
|
|||
/**
|
||||
* @brief The IEEE 802.15.4 enter sleep.
|
||||
*/
|
||||
|
||||
void esp_ieee802154_enter_sleep(void);
|
||||
|
||||
/**
|
||||
|
|
|
@ -139,6 +139,11 @@ if(CONFIG_OPENTHREAD_ENABLED)
|
|||
"src/esp_openthread_dns64.c")
|
||||
endif()
|
||||
|
||||
if(NOT CONFIG_FREERTOS_USE_TICKLESS_IDLE)
|
||||
list(APPEND exclude_srcs
|
||||
"src/port/esp_openthread_sleep.c")
|
||||
endif()
|
||||
|
||||
if(CONFIG_OPENTHREAD_FTD)
|
||||
set(device_type "OPENTHREAD_FTD=1")
|
||||
elseif(CONFIG_OPENTHREAD_MTD)
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "esp_err.h"
|
||||
#include "sdkconfig.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -4,11 +4,12 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include "sdkconfig.h"
|
||||
|
||||
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
|
||||
#include "esp_log.h"
|
||||
#include "esp_check.h"
|
||||
#include "esp_ieee802154.h"
|
||||
|
||||
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
|
||||
#include "esp_pm.h"
|
||||
static esp_pm_lock_handle_t s_pm_lock = NULL;
|
||||
static const char* TAG = "esp openthread sleep";
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
# OpenThread Sleepy Device Example
|
||||
|
||||
The example demonstrates the Thread Sleepy End Device (SED), the device will enter [Light Sleep mode](https://docs.espressif.com/projects/esp-idf/en/latest/esp32h2/api-reference/system/sleep_modes.html#sleep-modes) during idle state.
|
||||
The example demonstrates the Thread Sleepy End Device (SED), the device will enter [Light Sleep mode](https://docs.espressif.com/projects/esp-idf/en/latest/esp32c6/api-reference/system/sleep_modes.html#sleep-modes) during idle state.
|
||||
## How to use example
|
||||
|
||||
### Hardware Required
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "esp_err.h"
|
||||
#include "esp_event.h"
|
||||
#include "esp_log.h"
|
||||
|
@ -41,8 +40,7 @@
|
|||
|
||||
static void create_config_network(otInstance *instance)
|
||||
{
|
||||
otLinkModeConfig linkMode;
|
||||
memset(&linkMode, 0, sizeof(otLinkModeConfig));
|
||||
otLinkModeConfig linkMode = { 0 };
|
||||
|
||||
linkMode.mRxOnWhenIdle = false;
|
||||
linkMode.mDeviceType = false;
|
||||
|
@ -136,7 +134,6 @@ void app_main(void)
|
|||
ESP_ERROR_CHECK(esp_event_loop_create_default());
|
||||
ESP_ERROR_CHECK(esp_netif_init());
|
||||
ESP_ERROR_CHECK(esp_vfs_eventfd_register(&eventfd_config));
|
||||
|
||||
ESP_ERROR_CHECK(ot_power_save_init());
|
||||
|
||||
xTaskCreate(ot_task_worker, "ot_power_save_main", 4096, NULL, 5, NULL);
|
||||
|
|
Ładowanie…
Reference in New Issue