Browse Source

ble:config.c remove the error code when there is no file in the nvs because it is not an error.

gengyuchao 6 years ago
parent
commit
8e1a28940c
1 changed files with 3 additions and 0 deletions
  1. 3 0
      components/bt/common/osi/config.c

+ 3 - 0
components/bt/common/osi/config.c

@@ -545,6 +545,9 @@ static void config_parse(nvs_handle_t fp, config_t *config)
     char *keyname = osi_calloc(keyname_bufsz);
     int buf_size = get_config_size_from_flash(fp);
     char *buf = osi_calloc(buf_size);
+    if(buf_size == 0) { //First use nvs
+        goto error;
+    }
     if (!line || !section || !buf || !keyname) {
         err_code |= 0x01;
         goto error;