Skip to content
Commit 2e6983c0 authored by Joakim Andersson's avatar Joakim Andersson Committed by Johan Hedberg
Browse files

Bluetooth: GATT: Fix invalid DB hast written to settings storage



Fix issue where an invalid (all zeroes) hash was written to settings
storage on reset. This caused the old value to written to zeroes, before
being written back to it's original value again immediately after.
This causes excessive flash wear.

This happens because the check if (k_delayed_work_remaining) returns the
amount of time until the work will execute. When that time has run out
the time is zero, but the work has not yet been executed.
We then write the invalid hash to flash, and then once the work-item
executes it will write the correct value.

Signed-off-by: default avatarJoakim Andersson <joakim.andersson@nordicsemi.no>
parent ee3f634c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment