Contiki 2.5
usb-main.c
1 #include <stdint.h>
2 #include <stdio.h>
3 #include <debug-uart.h>
4 #include <sys/process.h>
5 #include <sys/procinit.h>
6 #include <etimer.h>
7 #include <sys/autostart.h>
8 #include <clock.h>
9 
10 unsigned int idle_count = 0;
11 
12 int
14 {
15  dbg_setup_uart();
16  printf("Initialising\n");
17 
18  clock_init();
19  process_init();
20  process_start(&etimer_process, NULL);
21  autostart_start(autostart_processes);
22  printf("Processes running\n");
23  while(1) {
24  do {
25  } while(process_run() > 0);
26  idle_count++;
27  /* Idle! */
28  /* Stop processor clock */
29  *AT91C_PMC_SCDR |= AT91C_PMC_PCK;
30  }
31  return 0;
32 }