19 lines
342 B
C
19 lines
342 B
C
#include "osr_ble.h"
|
|
|
|
#include <nvs.h>
|
|
#include <nvs_flash.h>
|
|
|
|
void nvs_init() {
|
|
esp_err_t ret = nvs_flash_init();
|
|
if (ret == ESP_ERR_NVS_NO_FREE_PAGES ||
|
|
ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
|
|
ESP_ERROR_CHECK(nvs_flash_erase());
|
|
ret = nvs_flash_init();
|
|
}
|
|
ESP_ERROR_CHECK(ret);
|
|
}
|
|
|
|
void osr_ble_init() {
|
|
nvs_init();
|
|
}
|