diff --git a/ports/arm7a/arm_main.c b/ports/arm7a/arm_main.c index b0242ff..5546e7d 100644 --- a/ports/arm7a/arm_main.c +++ b/ports/arm7a/arm_main.c @@ -218,13 +218,14 @@ int main ( void ) */ static void main_thread_func (uint32_t data) { - while (1) { - /* Put a message out on the UART */ - printk("Running Tests... "); - if (test_start() != 0) { - printk("FAILED!\n"); - } else { - printk("SUCCESS!\n"); - } + /* Put a message out on the UART */ + printk("Test Started ... "); + if (test_start() != 0) { + printk("FAILED!\n"); + } else { + printk("SUCCESS!\n"); } + printk("Reset your board !!!!!"); + /* Test finished so just hang !!! */ + while (1); } diff --git a/tests/kern3.c b/tests/kern3.c index d54312f..a149d72 100644 --- a/tests/kern3.c +++ b/tests/kern3.c @@ -45,9 +45,9 @@ static uint8_t test_thread_stack[NUM_TEST_THREADS][TEST_THREAD_STACK_SIZE]; static volatile int running_flag[2]; static volatile int sleep_request[2]; + /* Forward declarations */ static void test_thread_func (uint32_t param); -static int test_iter = 0; /** @@ -93,29 +93,23 @@ uint32_t test_start (void) running_flag[0] = running_flag[1] = FALSE; sleep_request[0] = sleep_request[1] = FALSE; - /* Create threads in first iteration only */ - if (test_iter == 0) { - /* Create low priority thread */ - if (atomThreadCreate (&tcb[0], 253, test_thread_func, 0, - &test_thread_stack[0][0], - TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK) - { - ATOMLOG (_STR("Bad thread create\n")); - failures++; - } - - /* Create high priority thread */ - else if (atomThreadCreate (&tcb[1], 252, test_thread_func, 1, - &test_thread_stack[1][0], - TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK) - { - ATOMLOG (_STR("Bad thread create\n")); - failures++; - } + /* Create low priority thread */ + if (atomThreadCreate (&tcb[0], 253, test_thread_func, 0, + &test_thread_stack[0][0], + TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK) + { + ATOMLOG (_STR("Bad thread create\n")); + failures++; } - /* Increment test iteration count */ - test_iter++; + /* Create high priority thread */ + else if (atomThreadCreate (&tcb[1], 252, test_thread_func, 1, + &test_thread_stack[1][0], + TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK) + { + ATOMLOG (_STR("Bad thread create\n")); + failures++; + } /* Repeat test a few times */ for (i = 0; i < 8; i++) diff --git a/tests/kern4.c b/tests/kern4.c index 253b05a..23ed33b 100644 --- a/tests/kern4.c +++ b/tests/kern4.c @@ -51,7 +51,7 @@ static int volatile test_started; /* Forward declarations */ static void test_thread_func (uint32_t param); -static int test_iter = 0; + /** * \b test_start @@ -89,47 +89,41 @@ uint32_t test_start (void) /* Set test as not started until all threads are ready to go */ test_started = FALSE; - /* Create threads in first iteration only */ - if (test_iter == 0) { - /* - * Create all four threads at the same priority as each other. - * They are given a lower priority than this thread, however, - * to ensure that once this thread wakes up to stop the test it - * can do so without confusing the scheduling tests by having - * a spell in which this thread was run. - */ - if (atomThreadCreate (&tcb[0], TEST_THREAD_PRIO + 1, test_thread_func, 0, - &test_thread_stack[0][0], - TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK) - { - ATOMLOG (_STR("Bad thread create\n")); - failures++; - } - else if (atomThreadCreate (&tcb[1], TEST_THREAD_PRIO + 1, test_thread_func, 1, - &test_thread_stack[1][0], - TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK) - { - ATOMLOG (_STR("Bad thread create\n")); - failures++; - } - else if (atomThreadCreate (&tcb[2], TEST_THREAD_PRIO + 1, test_thread_func, 2, - &test_thread_stack[2][0], - TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK) - { - ATOMLOG (_STR("Bad thread create\n")); - failures++; - } - else if (atomThreadCreate (&tcb[3], TEST_THREAD_PRIO + 1, test_thread_func, 3, - &test_thread_stack[3][0], - TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK) - { - ATOMLOG (_STR("Bad thread create\n")); - failures++; - } + /* + * Create all four threads at the same priority as each other. + * They are given a lower priority than this thread, however, + * to ensure that once this thread wakes up to stop the test it + * can do so without confusing the scheduling tests by having + * a spell in which this thread was run. + */ + if (atomThreadCreate (&tcb[0], TEST_THREAD_PRIO + 1, test_thread_func, 0, + &test_thread_stack[0][0], + TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK) + { + ATOMLOG (_STR("Bad thread create\n")); + failures++; + } + else if (atomThreadCreate (&tcb[1], TEST_THREAD_PRIO + 1, test_thread_func, 1, + &test_thread_stack[1][0], + TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK) + { + ATOMLOG (_STR("Bad thread create\n")); + failures++; + } + else if (atomThreadCreate (&tcb[2], TEST_THREAD_PRIO + 1, test_thread_func, 2, + &test_thread_stack[2][0], + TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK) + { + ATOMLOG (_STR("Bad thread create\n")); + failures++; + } + else if (atomThreadCreate (&tcb[3], TEST_THREAD_PRIO + 1, test_thread_func, 3, + &test_thread_stack[3][0], + TEST_THREAD_STACK_SIZE, TRUE) != ATOM_OK) + { + ATOMLOG (_STR("Bad thread create\n")); + failures++; } - - /* Increment test iteration count */ - test_iter++; /* Start the test */ test_started = TRUE;