mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-02 14:49:04 +00:00
ble_mesh: Add ble mesh deinit functions
This commit is contained in:
@@ -45,6 +45,14 @@ static void bt_mesh_alarm_mutex_new(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void bt_mesh_alarm_mutex_free(void)
|
||||
{
|
||||
if (bm_alarm_lock) {
|
||||
osi_mutex_free(&bm_alarm_lock);
|
||||
bm_alarm_lock = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void bt_mesh_alarm_lock(void)
|
||||
{
|
||||
if (bm_alarm_lock) {
|
||||
@@ -67,6 +75,14 @@ static void bt_mesh_list_mutex_new(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void bt_mesh_list_mutex_free(void)
|
||||
{
|
||||
if (bm_list_lock) {
|
||||
osi_mutex_free(&bm_list_lock);
|
||||
bm_list_lock = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void bt_mesh_list_lock(void)
|
||||
{
|
||||
if (bm_list_lock) {
|
||||
@@ -89,6 +105,14 @@ static void bt_mesh_buf_mutex_new(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void bt_mesh_buf_mutex_free(void)
|
||||
{
|
||||
if (bm_buf_lock) {
|
||||
osi_mutex_free(&bm_buf_lock);
|
||||
bm_buf_lock = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void bt_mesh_buf_lock(void)
|
||||
{
|
||||
if (bm_buf_lock) {
|
||||
@@ -111,6 +135,14 @@ static void bt_mesh_atomic_mutex_new(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void bt_mesh_atomic_mutex_free(void)
|
||||
{
|
||||
if (bm_atomic_lock) {
|
||||
osi_mutex_free(&bm_atomic_lock);
|
||||
bm_atomic_lock = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void bt_mesh_atomic_lock(void)
|
||||
{
|
||||
if (bm_atomic_lock) {
|
||||
@@ -159,6 +191,18 @@ void bt_mesh_k_init(void)
|
||||
assert(bm_alarm_hash_map != NULL);
|
||||
}
|
||||
|
||||
void bt_mesh_k_deinit(void)
|
||||
{
|
||||
bt_mesh_alarm_mutex_free();
|
||||
bt_mesh_list_mutex_free();
|
||||
bt_mesh_buf_mutex_free();
|
||||
bt_mesh_atomic_mutex_free();
|
||||
if (bm_alarm_hash_map) {
|
||||
hash_map_free(bm_alarm_hash_map);
|
||||
bm_alarm_hash_map = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void k_delayed_work_init(struct k_delayed_work *work, k_work_handler_t handler)
|
||||
{
|
||||
osi_alarm_t *alarm = NULL;
|
||||
|
Reference in New Issue
Block a user