mirror of
https://github.com/espressif/esp-idf
synced 2025-03-12 18:49:08 -04:00
ble_mesh: fix postponing storage deadline indefinitely
This commit is contained in:
parent
18b873b2e3
commit
6b7b9d1550
@ -846,7 +846,7 @@ int settings_core_commit(void)
|
|||||||
|
|
||||||
static void schedule_store(int flag)
|
static void schedule_store(int flag)
|
||||||
{
|
{
|
||||||
s32_t timeout;
|
s32_t timeout, remaining;
|
||||||
|
|
||||||
bt_mesh_atomic_set_bit(bt_mesh.flags, flag);
|
bt_mesh_atomic_set_bit(bt_mesh.flags, flag);
|
||||||
|
|
||||||
@ -861,6 +861,12 @@ static void schedule_store(int flag)
|
|||||||
timeout = K_SECONDS(CONFIG_BLE_MESH_STORE_TIMEOUT);
|
timeout = K_SECONDS(CONFIG_BLE_MESH_STORE_TIMEOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
remaining = k_delayed_work_remaining_get(&pending_store);
|
||||||
|
if (remaining && remaining < timeout) {
|
||||||
|
BT_DBG("Not rescheduling due to existing earlier deadline");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
BT_DBG("Waiting %d seconds", timeout / MSEC_PER_SEC);
|
BT_DBG("Waiting %d seconds", timeout / MSEC_PER_SEC);
|
||||||
|
|
||||||
if (timeout) {
|
if (timeout) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user