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 2016/12/19 21:54:40 UTC

[2/5] incubator-mynewt-core git commit: During selftest, crash on reset (don't hang).

During selftest, crash on reset (don't hang).


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/e552c7e0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/e552c7e0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/e552c7e0

Branch: refs/heads/develop
Commit: e552c7e08f2f46c0565c84e8b3c7988a69767e81
Parents: 9fc7241
Author: Christopher Collins <cc...@apache.org>
Authored: Fri Dec 16 16:39:05 2016 -0800
Committer: Christopher Collins <cc...@apache.org>
Committed: Mon Dec 19 13:43:57 2016 -0800

----------------------------------------------------------------------
 hw/mcu/native/src/hal_system.c | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e552c7e0/hw/mcu/native/src/hal_system.c
----------------------------------------------------------------------
diff --git a/hw/mcu/native/src/hal_system.c b/hw/mcu/native/src/hal_system.c
index ca16433..5931c81 100644
--- a/hw/mcu/native/src/hal_system.c
+++ b/hw/mcu/native/src/hal_system.c
@@ -20,13 +20,20 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
+#include <assert.h>
 
+#include "syscfg/syscfg.h"
 #include "hal/hal_system.h"
 #include "mcu/mcu_sim.h"
 
 void
 hal_system_reset(void)
 {
+#if MYNEWT_VAL(SELFTEST)
+    /* Don't hang in the middle of a unit test. */
+    assert(0);
+#endif
+
     while(1);
 }