blob: 19c75a9817247203c77c8df9fbcacff4a2b728ea [file] [log] [blame]
adamdunkelsd9ae56d2003-04-11 20:29:28 +00001/*
2 * Copyright (c) 2002, Adam Dunkels.
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.
adamdunkels1dc4ca02004-07-04 19:58:55 +000014 * 3. The name of the author may not be used to endorse or promote
adamdunkelsd9ae56d2003-04-11 20:29:28 +000015 * 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 * This file is part of the Contiki desktop environment
31 *
adamdunkels1dc4ca02004-07-04 19:58:55 +000032 * $Id: contiki-main.c,v 1.2 2004/07/04 19:58:55 adamdunkels Exp $
adamdunkelsd9ae56d2003-04-11 20:29:28 +000033 *
34 */
35
36#include "ctk.h"
37#include "ctk-draw.h"
adamdunkels1dc4ca02004-07-04 19:58:55 +000038#include "ek.h"
39#include "clock.h"
adamdunkelsd9ae56d2003-04-11 20:29:28 +000040
adamdunkelsd9ae56d2003-04-11 20:29:28 +000041#include "uip.h"
42#include "uip_arp.h"
adamdunkelsd9ae56d2003-04-11 20:29:28 +000043#include "resolv.h"
44
45#include "program-handler.h"
46
adamdunkels1dc4ca02004-07-04 19:58:55 +000047clock_time_t
48clock_time(void)
49{
50 return clock();
51}
adamdunkelsd9ae56d2003-04-11 20:29:28 +000052/*-----------------------------------------------------------------------------------*/
53int
adamdunkels1dc4ca02004-07-04 19:58:55 +000054main(void)
adamdunkelsd9ae56d2003-04-11 20:29:28 +000055{
56
adamdunkels1dc4ca02004-07-04 19:58:55 +000057 ek_init();
58
adamdunkelsd9ae56d2003-04-11 20:29:28 +000059#ifdef WITH_UIP
60 uip_init();
61 uip_main_init();
62 resolv_init();
63
64#ifdef WITH_RS232
65 rs232dev_init();
66#endif /* WITH_RS232 */
67
68#endif /* WITH_UIP */
69
adamdunkelsd9ae56d2003-04-11 20:29:28 +000070 ctk_init();
71
72 program_handler_init();
adamdunkels1dc4ca02004-07-04 19:58:55 +000073
74 while(1) {
75 ek_run();
76 }
adamdunkelsd9ae56d2003-04-11 20:29:28 +000077
78 clrscr();
79
80 return 0;
adamdunkelsd9ae56d2003-04-11 20:29:28 +000081}
82/*-----------------------------------------------------------------------------------*/