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 2017/01/25 22:36:35 UTC
[5/6] incubator-mynewt-core git commit: split_app;
split loaders need to enter app by calling hal_system_restart().
Change the _start_split() to start OS same way as _start does.
split_app; split loaders need to enter app by calling hal_system_restart().
Change the _start_split() to start OS same way as _start does.
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/5bc9d43d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/5bc9d43d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/5bc9d43d
Branch: refs/heads/develop
Commit: 5bc9d43de56c80a4cca44995da048185ac08d8e3
Parents: fd7bb7c
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Wed Jan 25 14:30:08 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Wed Jan 25 14:32:31 2017 -0800
----------------------------------------------------------------------
apps/slinky/src/main.c | 2 +-
boot/split_app/src/split_app.c | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/5bc9d43d/apps/slinky/src/main.c
----------------------------------------------------------------------
diff --git a/apps/slinky/src/main.c b/apps/slinky/src/main.c
index 956ce38..b619356 100755
--- a/apps/slinky/src/main.c
+++ b/apps/slinky/src/main.c
@@ -281,7 +281,7 @@ main(int argc, char **argv)
void *entry;
rc = split_app_go(&entry, true);
if(rc == 0) {
- hal_system_start(entry);
+ hal_system_restart(entry);
}
}
#endif
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/5bc9d43d/boot/split_app/src/split_app.c
----------------------------------------------------------------------
diff --git a/boot/split_app/src/split_app.c b/boot/split_app/src/split_app.c
index aa533bb..1f748ad 100644
--- a/boot/split_app/src/split_app.c
+++ b/boot/split_app/src/split_app.c
@@ -18,6 +18,9 @@
*/
#include <stdlib.h>
+#include <sysinit/sysinit.h>
+#include <os/os.h>
+
extern int main(int argc, char **argv);
/**
@@ -39,8 +42,13 @@ extern int main(int argc, char **argv);
void
_start_split(void)
{
+#if !MYNEWT_VAL(OS_SCHEDULING)
int rc;
rc = main(0, NULL);
exit(rc);
+#else
+ os_init(main);
+ os_start();
+#endif
}