Procházet zdrojové kódy

Merge branch 'feature/nvs_multi_page_util' into 'master'

Bugfix: multi page blob creation was failing if only one entry was left in page

See merge request idf/esp-idf!2971
Angus Gratton před 7 roky
rodič
revize
3012b0f887

+ 2 - 2
components/nvs_flash/nvs_partition_generator/nvs_partition_gen.py

@@ -128,8 +128,8 @@ class Page(object):
             chunk_size = 0
 
             # Get the size available in current page
-            if self.entry_num < (Page.PAGE_PARAMS["max_entries"] - 1):
-                tailroom = (Page.PAGE_PARAMS["max_entries"] - self.entry_num - 1) * Page.SINGLE_ENTRY_SIZE
+            tailroom = (Page.PAGE_PARAMS["max_entries"] - self.entry_num - 1) * Page.SINGLE_ENTRY_SIZE
+            assert tailroom >=0, "Page overflow!!"
 
             # Split the binary data into two and store a chunk of available size onto curr page
             if tailroom < remaining_size: