You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2016/01/11 18:46:06 UTC

incubator-mynewt-larva git commit: Add image slot picker for Olimex.

Repository: incubator-mynewt-larva
Updated Branches:
  refs/heads/master 05e4b4d6f -> 30058663d


Add image slot picker for Olimex.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/30058663
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/30058663
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/30058663

Branch: refs/heads/master
Commit: 30058663daecd072bdf203af5a1caf896c0eb650
Parents: 05e4b4d
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Mon Jan 11 09:41:52 2016 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Mon Jan 11 09:41:52 2016 -0800

----------------------------------------------------------------------
 hw/bsp/olimex_stm32-e407_devboard/include/bsp/bsp.h |  2 ++
 hw/bsp/olimex_stm32-e407_devboard/src/os_bsp.c      | 15 ++++++++++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/30058663/hw/bsp/olimex_stm32-e407_devboard/include/bsp/bsp.h
----------------------------------------------------------------------
diff --git a/hw/bsp/olimex_stm32-e407_devboard/include/bsp/bsp.h b/hw/bsp/olimex_stm32-e407_devboard/include/bsp/bsp.h
index f4754d6..fc4c56a 100644
--- a/hw/bsp/olimex_stm32-e407_devboard/include/bsp/bsp.h
+++ b/hw/bsp/olimex_stm32-e407_devboard/include/bsp/bsp.h
@@ -27,6 +27,8 @@ extern "C" {
 #define UART_CNT 1
 #define CONSOLE_UART 0
 
+int bsp_imgr_current_slot(void);
+
 #ifdef __cplusplus
 }
 #endif

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/30058663/hw/bsp/olimex_stm32-e407_devboard/src/os_bsp.c
----------------------------------------------------------------------
diff --git a/hw/bsp/olimex_stm32-e407_devboard/src/os_bsp.c b/hw/bsp/olimex_stm32-e407_devboard/src/os_bsp.c
index 72f3385..fc8744f 100644
--- a/hw/bsp/olimex_stm32-e407_devboard/src/os_bsp.c
+++ b/hw/bsp/olimex_stm32-e407_devboard/src/os_bsp.c
@@ -51,6 +51,20 @@ static struct flash_area bsp_flash_areas[] = {
 void *_sbrk(int incr);
 void _close(int fd);
 
+/*
+ * Returns the flash map slot where the currently active image is located.
+ * If executing from internal flash from fixed location, that slot would
+ * be easy to find.
+ * If images are in external flash, and copied to RAM for execution, then
+ * this routine would have to figure out which one of those slots is being
+ * used.
+ */
+int
+bsp_imgr_current_slot(void)
+{
+    return FLASH_AREA_IMAGE_0;
+}
+
 void
 os_bsp_init(void)
 {
@@ -63,4 +77,3 @@ os_bsp_init(void)
                     sizeof(bsp_flash_areas) / sizeof(bsp_flash_areas[0]));
 }
 
-