diff --git a/examples/rime/example-abc.c b/examples/rime/example-abc.c index 8e255f9b6..9095338d2 100644 --- a/examples/rime/example-abc.c +++ b/examples/rime/example-abc.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: example-abc.c,v 1.2 2008/10/02 21:08:58 fros4943 Exp $ + * $Id: example-abc.c,v 1.3 2009/02/07 22:28:25 adamdunkels Exp $ */ /** @@ -60,22 +60,25 @@ static struct abc_conn abc; /*---------------------------------------------------------------------------*/ PROCESS_THREAD(example_abc_process, ev, data) { + static struct etimer et; + PROCESS_EXITHANDLER(abc_close(&abc);) PROCESS_BEGIN(); abc_open(&abc, 128, &abc_call); - while(1) { - static struct etimer et; + etimer_set(&et, 2 * CLOCK_SECOND); - etimer_set(&et, 2*CLOCK_SECOND); + while(1) { PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et)); rimebuf_copyfrom("Hello", 6); abc_send(&abc); printf("abc message sent\n"); + + etimer_restart(&et); } PROCESS_END();