blob: 7c443f9807e43a29888a464c63eca96189408be0 [file] [log] [blame]
adamdunkels42071e22003-04-08 18:08:24 +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.
14 * 3. All advertising materials mentioning features or use of this
15 * software must display the following acknowledgement:
16 * This product includes software developed by Adam Dunkels.
17 * 4. The name of the author may not be used to endorse or promote
18 * products derived from this software without specific prior
19 * written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
22 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
25 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
27 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 * This file is part of the Contiki desktop environment
34 *
adamdunkels78b7a822004-07-04 19:51:19 +000035 * $Id: contiki-main.c,v 1.4 2004/07/04 19:51:19 adamdunkels Exp $
adamdunkels42071e22003-04-08 18:08:24 +000036 *
37 */
38
adamdunkels78b7a822004-07-04 19:51:19 +000039#include "contiki.h"
adamdunkels42071e22003-04-08 18:08:24 +000040#include "ctk-draw.h"
adamdunkels78b7a822004-07-04 19:51:19 +000041#include "ek.h"
adamdunkels42071e22003-04-08 18:08:24 +000042
43#include "program-handler.h"
adamdunkels0bde6652003-09-07 18:13:16 +000044#include "processes-dsc.h"
45#include "about-dsc.h"
46#include "netconf-dsc.h"
47#include "memstat-dsc.h"
adamdunkels42071e22003-04-08 18:08:24 +000048
adamdunkels07476a02004-06-06 06:35:12 +000049#include "uiplib.h"
adamdunkels42071e22003-04-08 18:08:24 +000050#include "uip.h"
51#include "uip_arp.h"
52#if WITH_TFE
53#include "cs8900a.h"
54#endif /* WITH_TFE */
55#include "resolv.h"
56
57
58
59/*-----------------------------------------------------------------------------------*/
60int
adamdunkels78b7a822004-07-04 19:51:19 +000061main(void)
adamdunkels42071e22003-04-08 18:08:24 +000062{
adamdunkels0bde6652003-09-07 18:13:16 +000063 /* toggle_videomode(); */ /* Turn on 80 column mode */
adamdunkels42071e22003-04-08 18:08:24 +000064
adamdunkels78b7a822004-07-04 19:51:19 +000065 ek_init();
adamdunkels0bde6652003-09-07 18:13:16 +000066
adamdunkels42071e22003-04-08 18:08:24 +000067#ifdef WITH_UIP
68 uip_init();
adamdunkels78b7a822004-07-04 19:51:19 +000069 tcpip_init();
adamdunkels42071e22003-04-08 18:08:24 +000070 resolv_init();
71
72#ifdef WITH_TFE
73 cs8900a_init();
74#endif /* WITH_TFE */
75
76
77#ifdef WITH_RS232
78 rs232dev_init();
79#endif /* WITH_RS232 */
80
81#ifdef WITH_TAPDEV
82 tapdev_init();
83#endif /* WITH_TAPDEV */
84
85
86#endif /* WITH_UIP */
87
adamdunkels42071e22003-04-08 18:08:24 +000088 ctk_init();
89
90 program_handler_init();
adamdunkels0bde6652003-09-07 18:13:16 +000091 program_handler_add(&about_dsc, "About", 1);
92 program_handler_add(&netconf_dsc, "Netconf", 1);
93 program_handler_add(&processes_dsc, "Processes", 1);
94 program_handler_add(&memstat_dsc, "Memory stats", 1);
95
96
adamdunkels78b7a822004-07-04 19:51:19 +000097 while(1) {
98 ek_run();
99 }
adamdunkels42071e22003-04-08 18:08:24 +0000100
101 clrscr();
102
103 return 0;
adamdunkels42071e22003-04-08 18:08:24 +0000104}
105/*-----------------------------------------------------------------------------------*/
adamdunkels78b7a822004-07-04 19:51:19 +0000106clock_time_t
107clock_time(void)
adamdunkels07476a02004-06-06 06:35:12 +0000108{
109 return clock();
110}