mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
Merge branch 'feature/refactor_with_broker_v6.1' into 'release/v6.1'
feat(bt): refactor bt sdk with broker for esp32h4 and esp32s31 (6.1) See merge request espressif/esp-idf!51757
This commit is contained in:
@@ -358,6 +358,29 @@ void os_mempool_flags_set(struct os_mempool *mp, uint8_t flags);
|
||||
*/
|
||||
void os_mempool_flags_clear(struct os_mempool *mp, uint8_t flags);
|
||||
|
||||
/**
|
||||
* @brief Deinitialize a memory pool.
|
||||
*
|
||||
* @param mp Pointer to memory pool
|
||||
*/
|
||||
void os_mempool_deinit(struct os_mempool *mp);
|
||||
|
||||
/**
|
||||
* @brief Deinitialize all of memory pools.
|
||||
*
|
||||
* @param is_controller Whether called from controller.
|
||||
*
|
||||
* @return OS_OK on success; OS_INVALID_PARM if not found corresponding memory pools.
|
||||
*/
|
||||
os_error_t os_mempool_deinit_all(bool is_controller);
|
||||
|
||||
/**
|
||||
* @brief Check if there are any live memory pools.
|
||||
*
|
||||
* @return true if there are any live memory pools; false otherwise.
|
||||
*/
|
||||
bool os_mempool_has_live_pool(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -735,6 +735,11 @@ os_mempool_module_init(void)
|
||||
static os_error_t
|
||||
os_mempool_mem_free(struct os_mempool *mp)
|
||||
{
|
||||
/* Extended mempool has its own free logic */
|
||||
if (mp->mp_flags & OS_MEMPOOL_F_EXT) {
|
||||
return OS_OK;
|
||||
}
|
||||
|
||||
/* For runtime allocation mode, check whether all blocks have been freed */
|
||||
if (!(mp->mp_flags & OS_MEMPOOL_F_RUNTIME)) {
|
||||
return OS_EINVAL;
|
||||
@@ -767,8 +772,15 @@ os_mempool_mem_free(struct os_mempool *mp)
|
||||
#endif
|
||||
|
||||
void
|
||||
os_mempool_deinit(bool is_controller)
|
||||
os_mempool_deinit(struct os_mempool *mp)
|
||||
{
|
||||
os_mempool_unregister(mp);
|
||||
}
|
||||
|
||||
os_error_t
|
||||
os_mempool_deinit_all(bool is_controller)
|
||||
{
|
||||
os_error_t err = OS_INVALID_PARM;
|
||||
struct os_mempool *mp = NULL;
|
||||
struct os_mempool *next = NULL;
|
||||
|
||||
@@ -780,8 +792,17 @@ os_mempool_deinit(bool is_controller)
|
||||
next = STAILQ_NEXT(mp, mp_list);
|
||||
os_mempool_unregister(mp);
|
||||
mp = next;
|
||||
err = OS_OK;
|
||||
} else {
|
||||
mp = STAILQ_NEXT(mp, mp_list);
|
||||
}
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
bool
|
||||
os_mempool_has_live_pool(void)
|
||||
{
|
||||
return !STAILQ_EMPTY(&g_os_mempool_list);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2024-2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -169,11 +169,10 @@ hci_transport_deinit(void)
|
||||
{
|
||||
hci_driver_ops_t *ops;
|
||||
|
||||
r_ble_hci_trans_cfg_hs((esp_hci_internal_rx_cmd_fn *)hci_transport_controller_tx_dummy, NULL,
|
||||
(esp_hci_internal_rx_acl_fn *)hci_transport_controller_tx_dummy, NULL);
|
||||
|
||||
ops = s_hci_transport_env.driver_ops;
|
||||
if (ops) {
|
||||
r_ble_hci_trans_cfg_hs((esp_hci_internal_rx_cmd_fn *)hci_transport_controller_tx_dummy, NULL,
|
||||
(esp_hci_internal_rx_acl_fn *)hci_transport_controller_tx_dummy, NULL);
|
||||
ops->hci_driver_deinit();
|
||||
}
|
||||
memset(&s_hci_transport_env, 0, sizeof(hci_transport_env_t));
|
||||
|
||||
Reference in New Issue
Block a user