X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=apps%2Ftosthreads%2Fcapps%2FTestJoin%2FTestJoin.c;h=5952d39709648b516ebadece8b94238ca6d07bf6;hb=82b0ae40259e7b3a31b13b9a379d82c2011fd4c4;hp=0470c414252c9656182cb1903bbc240849d5c0da;hpb=8b80d9d0c58ecf3012efb74ec3d4d1f5e599ccda;p=tinyos-2.x.git diff --git a/apps/tosthreads/capps/TestJoin/TestJoin.c b/apps/tosthreads/capps/TestJoin/TestJoin.c index 0470c414..5952d397 100644 --- a/apps/tosthreads/capps/TestJoin/TestJoin.c +++ b/apps/tosthreads/capps/TestJoin/TestJoin.c @@ -30,6 +30,14 @@ */ /** + * TestJoin is a simple application used to test the basic functionality of + * the join() system call for waiting on a set of threads in a TOSThreads + * based application. + * + * Upon a successful burn, you should first see LED0 flash twice with a period of + * 1s and LED1 flash 4 times with a period of 1s. After these are done, + * LED2 should come on and stay on. + * * @author Kevin Klues (klueska@cs.stanford.edu) */ @@ -41,12 +49,10 @@ tosthread_t init; tosthread_t blink0; tosthread_t blink1; -tosthread_t blink2; void init_thread(void* arg); void blink0_thread(void* arg); void blink1_thread(void* arg); -void blink2_thread(void* arg); void tosthread_main(void* arg) { //Use stack estimator to calculate maximum stack size @@ -58,10 +64,9 @@ void init_thread(void* arg) { for(;;) { tosthread_create(&blink0, blink0_thread, NULL, BLINK0_STACK_SIZE); tosthread_create(&blink1, blink1_thread, NULL, BLINK1_STACK_SIZE); - tosthread_create(&blink2, blink2_thread, NULL, BLINK2_STACK_SIZE); - tosthread_join(&blink2); tosthread_join(&blink0); tosthread_join(&blink1); + led2Toggle(); } } @@ -81,10 +86,3 @@ void blink1_thread(void* arg) { } } -void blink2_thread(void* arg) { - int i; - for(i=0; i<6; i++) { - led2Toggle(); - tosthread_sleep(1000); - } -}