]> granicus.if.org Git - esp-idf/commitdiff
Merge branch 'feature/nvs_util_backport' into 'master'
authorAngus Gratton <angus@espressif.com>
Mon, 24 Sep 2018 03:53:29 +0000 (11:53 +0800)
committerAngus Gratton <angus@espressif.com>
Mon, 24 Sep 2018 03:53:29 +0000 (11:53 +0800)
nvs_util: Add changes for utility to support old and new multipage blob

See merge request idf/esp-idf!3270

1  2 
components/nvs_flash/nvs_partition_generator/nvs_partition_gen.py

index cd07d7f41c7d22e028153155e7afcec580f57ad2,8d78b908e72c1188452bdc03ccec3ea10cfc154f..4446d084fc8118ada6c19510a8c4e646ac7b0336
@@@ -220,13 -239,18 +241,18 @@@ class Page(object)
          # Set size of data
          datalen = len(data)
  
-         if encoding == "string":
-             if datalen > Page.PAGE_PARAMS["max_blob_size"]:
+         if version == Page.VERSION1:
+             if datalen > Page.PAGE_PARAMS["max_old_blob_size"]:
                  raise InputError("%s: Size exceeds max allowed length." % key)
  
+         if version == Page.VERSION2:
+             if encoding == "string":
+                 if datalen > Page.PAGE_PARAMS["max_new_blob_size"]:
+                     raise InputError("%s: Size exceeds max allowed length." % key)
          # Calculate no. of entries data will require
          rounded_size = (datalen + 31) & ~31
 -        data_entry_count = rounded_size / 32
 +        data_entry_count = rounded_size // 32
          total_entry_count = data_entry_count + 1 # +1 for the entry header
  
          # Check if page is already full and new page is needed to be created right away