mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
ble_mesh: fix postponing storage deadline indefinitely
This commit is contained in:
parent
c44a3f1209
commit
9c98a8d645
@ -846,7 +846,7 @@ int settings_core_commit(void)
|
||||
|
||||
static void schedule_store(int flag)
|
||||
{
|
||||
s32_t timeout;
|
||||
s32_t timeout, remaining;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
if (timeout) {
|
||||
|
Loading…
Reference in New Issue
Block a user