You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2018/12/13 23:03:40 UTC
[mynewt-core] 02/02: sys/flash_map: Don't replace dflt flash map
with 0
This is an automated email from the ASF dual-hosted git repository.
ccollins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
commit 4a9ecdeafcd199a84a3f4d95f07400e4b299c86a
Author: Christopher Collins <cc...@apache.org>
AuthorDate: Wed Dec 12 17:09:43 2018 -0800
sys/flash_map: Don't replace dflt flash map with 0
If no flash areas were found in the MMR, keep using the hardcoded flash
map instead of an empty one.
---
sys/flash_map/src/flash_map.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/flash_map/src/flash_map.c b/sys/flash_map/src/flash_map.c
index 1cab37e..98c58d0 100644
--- a/sys/flash_map/src/flash_map.c
+++ b/sys/flash_map/src/flash_map.c
@@ -423,7 +423,7 @@ flash_map_init(void)
*/
rc = flash_map_read_mfg(sizeof mfg_areas / sizeof mfg_areas[0],
mfg_areas, &num_areas);
- if (rc == 0) {
+ if (rc == 0 && num_areas > 0) {
flash_map = mfg_areas;
flash_map_entries = num_areas;
}