You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change non-volatile storage driver for nRF51 to use fstorage
pstorage is deprecated and no longer works in mbed OS 5.4 projects due to ARMmbed/mbed-os#4181. This updates the driver to use fstorage, and also makes the driver work on nRF52.
Copy file name to clipboardExpand all lines: BLE_EddystoneService/source/PersistentStorageHelper/nrfPersistentStorageHelper/nrfConfigParamsPersistence.cpp
+36-40Lines changed: 36 additions & 40 deletions
Original file line number
Diff line number
Diff line change
@@ -14,14 +14,15 @@
14
14
* limitations under the License.
15
15
*/
16
16
17
-
#ifdefTARGET_NRF51822/* Persistent storage supported on nrf51 platforms */
17
+
#if defined(TARGET_NRF51822) || defined(TARGET_NRF52832) /* Persistent storage supported on nrf51 and nrf52 platforms */
18
18
19
19
extern"C" {
20
-
#include"pstorage.h"
20
+
#include"fstorage.h"
21
21
}
22
22
23
23
#include"nrf_error.h"
24
24
#include"../../EddystoneService.h"
25
+
#include<cstddef>
25
26
26
27
/**
27
28
* Nordic specific structure used to store params persistently.
@@ -37,55 +38,52 @@ struct PersistentParams_t {
37
38
38
39
/**
39
40
* The following is a module-local variable to hold configuration parameters for
40
-
* short periods during flash access. This is necessary because the pstorage
41
+
* short periods during flash access. This is necessary because the fstorage
41
42
* APIs don't copy in the memory provided as data source. The memory cannot be
42
43
* freed or reused by the application until this flash access is complete. The
43
44
* load and store operations in this module initialize persistentParams and then
44
-
* pass it on to the 'pstorage' APIs.
45
+
* pass it on to the 'fstorage' APIs.
45
46
*/
46
47
static PersistentParams_t persistentParams;
47
48
48
-
staticpstorage_handle_t pstorageHandle;
49
-
50
49
/**
51
-
* Dummy callback handler needed by Nordic's pstorage module. This is called
50
+
* Dummy callback handler needed by Nordic's fstorage module. This is called
0 commit comments