Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop d5a15930b -> 58308cc44


testbench - Ensure test tasks lower prio than main

The test tasks must have a lower priority than the main task (i.e.,
greater number).  These tasks should not start running until the main
task has created all of them and goes idle.  The reason is that these
tasks need to interract with one another, so they require all sibling
tasks to be running.


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

Branch: refs/heads/develop
Commit: 58308cc445d5f5553fde1a51d199d360e8e10ba3
Parents: bea2cc5
Author: Christopher Collins <[email protected]>
Authored: Thu Jan 26 18:10:43 2017 -0800
Committer: Christopher Collins <[email protected]>
Committed: Thu Jan 26 18:11:40 2017 -0800

----------------------------------------------------------------------
 apps/testbench/src/testbench.h    | 15 ---------------
 kernel/os/test/src/os_test_priv.h | 16 ++++++++++------
 2 files changed, 10 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/58308cc4/apps/testbench/src/testbench.h
----------------------------------------------------------------------
diff --git a/apps/testbench/src/testbench.h b/apps/testbench/src/testbench.h
index 4c15b5d..a94ee1c 100644
--- a/apps/testbench/src/testbench.h
+++ b/apps/testbench/src/testbench.h
@@ -126,25 +126,10 @@ extern char buildID[TESTBENCH_BUILDID_SZ];
 /*
  * Pool of test worker tasks and matching stacks
  */
-#ifndef TASK1_PRIO
-#define TASK1_PRIO (21) 
 struct os_task task1;
-#endif
-
-#ifndef TASK2_PRIO
-#define TASK2_PRIO (22) 
 struct os_task task2;
-#endif
-
-#ifndef TASK3_PRIO
-#define TASK3_PRIO (23) 
 struct os_task task3;
-#endif
-
-#ifndef TASK4_PRIO
-#define TASK4_PRIO (24) 
 struct os_task task4;
-#endif
 
 /*
  * stacks are re-used to minimize space on the target

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/58308cc4/kernel/os/test/src/os_test_priv.h
----------------------------------------------------------------------
diff --git a/kernel/os/test/src/os_test_priv.h 
b/kernel/os/test/src/os_test_priv.h
index c892ec8..e732c37 100644
--- a/kernel/os/test/src/os_test_priv.h
+++ b/kernel/os/test/src/os_test_priv.h
@@ -37,28 +37,32 @@
 extern "C" {
 #endif
 
-/*
- * shared amongst all os tests
+/* These test tasks must have a lower priority than the main task (i.e.,
+ * greater number).  These tasks should not start running until the main task
+ * has created all of them and goes idle.  The reason is that these tasks need
+ * to interract with one another, so they require all sibling tasks to be
+ * running.
  */
+#define TASK1_PRIO (MYNEWT_VAL(OS_MAIN_TASK_PRIO) + 1)
+#define TASK2_PRIO (TASK1_PRIO + 1)
+#define TASK3_PRIO (TASK2_PRIO + 1)
+#define TASK4_PRIO (TASK3_PRIO + 1)
+
 extern struct os_task task1;
 extern os_stack_t *stack1;
 extern uint32_t stack1_size;
-#define TASK1_PRIO (20) 
 
 extern struct os_task task2;
 extern os_stack_t *stack2;
 extern uint32_t stack2_size;
-#define TASK2_PRIO (21) 
 
 extern struct os_task task3;
 extern os_stack_t *stack3;
 extern uint32_t stack3_size;
-#define TASK3_PRIO (22) 
 
 extern struct os_task task4;
 extern os_stack_t *stack4;
 extern uint32_t stack4_size;
-#define TASK4_PRIO (23) 
 
 void os_test_restart(void);
 

Reply via email to