Contiki 2.6
|
00001 #include <stepper-process.h> 00002 #include <dev/leds.h> 00003 #include <loader/codeprop-otf.h> 00004 #include <loader/ram-segments.h> 00005 #include <sys/autostart.h> 00006 #include "codeprop-otf.h" 00007 #include <stdio.h> 00008 #include <stdlib.h> 00009 00010 PROCESS(blink_process, "LED blink process"); 00011 00012 PROCESS_THREAD(blink_process, ev , data) 00013 { 00014 static struct etimer timer; 00015 PROCESS_BEGIN(); 00016 etimer_set(&timer, CLOCK_SECOND/2); 00017 while(1) { 00018 PROCESS_WAIT_EVENT_UNTIL(ev == PROCESS_EVENT_EXIT || 00019 ev== PROCESS_EVENT_TIMER); 00020 if (ev == PROCESS_EVENT_EXIT) break; 00021 leds_invert(LEDS_RED); 00022 etimer_reset(&timer); 00023 } 00024 PROCESS_END(); 00025 } 00026 00027 AUTOSTART_PROCESSES(&codeprop_process, &ram_segments_cleanup_process, &stepper_process,&blink_process);