|
39 | 39 | #include "esp_pm.h" |
40 | 40 | #include "esp_phy_init.h" |
41 | 41 | #include "esp_private/periph_ctrl.h" |
42 | | -#include "bt_osi_mem.h" |
43 | | - |
44 | | -#if SOC_PM_RETENTION_HAS_CLOCK_BUG |
| 42 | +#include "soc/retention_periph_defs.h" |
45 | 43 | #include "esp_private/sleep_retention.h" |
46 | | -#endif // SOC_PM_RETENTION_HAS_CLOCK_BUG |
| 44 | +#include "soc/regdma.h" |
| 45 | +#include "bt_osi_mem.h" |
47 | 46 |
|
48 | 47 | #if CONFIG_FREERTOS_USE_TICKLESS_IDLE |
49 | 48 | #include "esp_private/sleep_modem.h" |
|
52 | 51 | #include "freertos/FreeRTOS.h" |
53 | 52 | #include "freertos/task.h" |
54 | 53 |
|
55 | | -#include "esp_private/periph_ctrl.h" |
56 | | -#include "esp_sleep.h" |
57 | | - |
58 | 54 | #include "hal/efuse_hal.h" |
59 | 55 | #include "soc/rtc.h" |
60 | 56 | /* Macro definition |
@@ -377,25 +373,53 @@ IRAM_ATTR void controller_wakeup_cb(void *arg) |
377 | 373 | } |
378 | 374 |
|
379 | 375 | #if CONFIG_FREERTOS_USE_TICKLESS_IDLE |
| 376 | +// TODO: IDF-10765 |
| 377 | +// static esp_err_t sleep_modem_ble_mac_retention_init(void *arg) |
| 378 | +// { |
| 379 | + // uint8_t size; |
| 380 | + // int extra = *(int *)arg; |
| 381 | + // const sleep_retention_entries_config_t *ble_mac_modem_config = esp_ble_mac_retention_link_get(&size, extra); |
| 382 | + // esp_err_t err = sleep_retention_entries_create(ble_mac_modem_config, size, REGDMA_LINK_PRI_BT_MAC_BB, SLEEP_RETENTION_MODULE_BLE_MAC); |
| 383 | + // if (err == ESP_OK) { |
| 384 | + // ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Modem BLE MAC retention initialization"); |
| 385 | + // } |
| 386 | + // return err; |
| 387 | +// return ESP_OK; |
| 388 | +// } |
| 389 | + |
380 | 390 | static esp_err_t sleep_modem_ble_mac_modem_state_init(uint8_t extra) |
381 | 391 | { |
382 | | - uint8_t size; |
383 | | - const sleep_retention_entries_config_t *ble_mac_modem_config = esp_ble_mac_retention_link_get(&size, extra); |
384 | | - esp_err_t err = sleep_retention_entries_create(ble_mac_modem_config, size, REGDMA_LINK_PRI_BT_MAC_BB, SLEEP_RETENTION_MODULE_BLE_MAC); |
385 | | - if (err == ESP_OK) { |
386 | | - ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Modem BLE MAC retention initialization"); |
387 | | - } |
388 | | - return err; |
| 392 | + // TODO: IDF-10765 |
| 393 | + // int retention_args = extra; |
| 394 | + // sleep_retention_module_init_param_t init_param = { |
| 395 | + // .cbs = { .create = { .handle = sleep_modem_ble_mac_retention_init, .arg = &retention_args } }, |
| 396 | + // .depends = BIT(SLEEP_RETENTION_MODULE_BT_BB) |
| 397 | + // }; |
| 398 | + // esp_err_t err = sleep_retention_module_init(SLEEP_RETENTION_MODULE_BLE_MAC, &init_param); |
| 399 | + // if (err == ESP_OK) { |
| 400 | + // err = sleep_retention_module_allocate(SLEEP_RETENTION_MODULE_BLE_MAC); |
| 401 | + // } |
| 402 | + // return err; |
| 403 | + ESP_LOGW(NIMBLE_PORT_LOG_TAG, "This func temporary not supported for current target!"); |
| 404 | + return ESP_OK; |
389 | 405 | } |
390 | 406 |
|
391 | 407 | static void sleep_modem_ble_mac_modem_state_deinit(void) |
392 | 408 | { |
393 | | - sleep_retention_entries_destroy(SLEEP_RETENTION_MODULE_BLE_MAC); |
| 409 | + // TODO: IDF-10765 |
| 410 | + // esp_err_t err = sleep_retention_module_free(SLEEP_RETENTION_MODULE_BLE_MAC); |
| 411 | + // if (err == ESP_OK) { |
| 412 | + // err = sleep_retention_module_deinit(SLEEP_RETENTION_MODULE_BLE_MAC); |
| 413 | + // assert(err == ESP_OK); |
| 414 | + // } |
| 415 | + ESP_LOGW(NIMBLE_PORT_LOG_TAG, "This func temporary not supported for current target!"); |
394 | 416 | } |
395 | 417 |
|
396 | 418 | void sleep_modem_light_sleep_overhead_set(uint32_t overhead) |
397 | 419 | { |
398 | | - esp_ble_set_wakeup_overhead(overhead); |
| 420 | + // TODO: IDF-10765 |
| 421 | + // esp_ble_set_wakeup_overhead(overhead); |
| 422 | + ESP_LOGW(NIMBLE_PORT_LOG_TAG, "This func temporary not supported for current target!"); |
399 | 423 | } |
400 | 424 | #endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */ |
401 | 425 |
|
|
0 commit comments