Contiki 2.5
contiki-main.c
1 /*
2  * Copyright (c) 2007, Takahide Matsutsuka.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above
11  * copyright notice, this list of conditions and the following
12  * disclaimer in the documentation and/or other materials provided
13  * with the distribution.
14  * 3. The name of the author may not be used to endorse or promote
15  * products derived from this software without specific prior
16  * written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
19  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  *
30  * $Id: contiki-main.c,v 1.4 2009/12/16 06:47:18 matsutsuka Exp $
31  *
32  */
33 
34 /*
35  * \file
36  * This is a main file for standard configuration.
37  * \author
38  * Takahide Matsutsuka <markn@markn.org>
39  */
40 
41 #include "contiki.h"
42 #include "ctk/ctk.h"
43 
44 #ifndef WITHOUT_GUI
45 #define CTK_PROCESS &ctk_process,
46 #else /* WITH_GUI */
47 #define CTK_PROCESS
48 #endif /* WITH_GUI */
49 
50 PROCINIT(CTK_PROCESS
51  &etimer_process);
52 
53 /*---------------------------------------------------------------------------*/
54 int
55 main(void)
56 {
57  /* initialize process manager. */
58  process_init();
59  autostart_start(autostart_processes);
60 
61  while(1) {
62  process_run();
64  }
65 }