This is an automated email from the ASF dual-hosted git repository.
jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
The following commit(s) were added to refs/heads/master by this push:
new 959db9ffd sys/flash_map: Allow build with 1 flash image area
959db9ffd is described below
commit 959db9ffdf67df2cedd4ca1460a4c5c5137b2741
Author: Jerzy Kasenberg <[email protected]>
AuthorDate: Fri Apr 5 08:19:08 2024 +0200
sys/flash_map: Allow build with 1 flash image area
When bootloader alone can write new image to device
(no swap needed) there is no need to define fake
flash area anymore.
This allows build when there is no definition for secondary
swap image flash area.
Signed-off-by: Jerzy Kasenberg <[email protected]>
---
sys/flash_map/src/flash_map.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/sys/flash_map/src/flash_map.c b/sys/flash_map/src/flash_map.c
index ff0324629..c3e88dc9d 100644
--- a/sys/flash_map/src/flash_map.c
+++ b/sys/flash_map/src/flash_map.c
@@ -334,8 +334,10 @@ flash_area_id_from_image_slot(int slot)
switch (slot) {
case 0:
return FLASH_AREA_IMAGE_0;
+#ifdef FLASH_AREA_IMAGE_1
case 1:
return FLASH_AREA_IMAGE_1;
+#endif
default:
assert(0);
return FLASH_AREA_IMAGE_0;
@@ -352,8 +354,10 @@ flash_area_id_to_image_slot(int area_id)
switch (area_id) {
case FLASH_AREA_IMAGE_0:
return 0;
+#ifdef FLASH_AREA_IMAGE_1
case FLASH_AREA_IMAGE_1:
return 1;
+#endif
default:
return -1;
}