adamdunkels | d9ae56d | 2003-04-11 20:29:28 +0000 | [diff] [blame] | 1 | /* |
| 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. |
adamdunkels | 1dc4ca0 | 2004-07-04 19:58:55 +0000 | [diff] [blame] | 14 | * 3. The name of the author may not be used to endorse or promote |
adamdunkels | d9ae56d | 2003-04-11 20:29:28 +0000 | [diff] [blame] | 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 | * This file is part of the Contiki desktop environment |
| 31 | * |
adamdunkels | 1dc4ca0 | 2004-07-04 19:58:55 +0000 | [diff] [blame] | 32 | * $Id: contiki-main.c,v 1.2 2004/07/04 19:58:55 adamdunkels Exp $ |
adamdunkels | d9ae56d | 2003-04-11 20:29:28 +0000 | [diff] [blame] | 33 | * |
| 34 | */ |
| 35 | |
| 36 | #include "ctk.h" |
| 37 | #include "ctk-draw.h" |
adamdunkels | 1dc4ca0 | 2004-07-04 19:58:55 +0000 | [diff] [blame] | 38 | #include "ek.h" |
| 39 | #include "clock.h" |
adamdunkels | d9ae56d | 2003-04-11 20:29:28 +0000 | [diff] [blame] | 40 | |
adamdunkels | d9ae56d | 2003-04-11 20:29:28 +0000 | [diff] [blame] | 41 | #include "uip.h" |
| 42 | #include "uip_arp.h" |
adamdunkels | d9ae56d | 2003-04-11 20:29:28 +0000 | [diff] [blame] | 43 | #include "resolv.h" |
| 44 | |
| 45 | #include "program-handler.h" |
| 46 | |
adamdunkels | 1dc4ca0 | 2004-07-04 19:58:55 +0000 | [diff] [blame] | 47 | clock_time_t |
| 48 | clock_time(void) |
| 49 | { |
| 50 | return clock(); |
| 51 | } |
adamdunkels | d9ae56d | 2003-04-11 20:29:28 +0000 | [diff] [blame] | 52 | /*-----------------------------------------------------------------------------------*/ |
| 53 | int |
adamdunkels | 1dc4ca0 | 2004-07-04 19:58:55 +0000 | [diff] [blame] | 54 | main(void) |
adamdunkels | d9ae56d | 2003-04-11 20:29:28 +0000 | [diff] [blame] | 55 | { |
| 56 | |
adamdunkels | 1dc4ca0 | 2004-07-04 19:58:55 +0000 | [diff] [blame] | 57 | ek_init(); |
| 58 | |
adamdunkels | d9ae56d | 2003-04-11 20:29:28 +0000 | [diff] [blame] | 59 | #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 | |
adamdunkels | d9ae56d | 2003-04-11 20:29:28 +0000 | [diff] [blame] | 70 | ctk_init(); |
| 71 | |
| 72 | program_handler_init(); |
adamdunkels | 1dc4ca0 | 2004-07-04 19:58:55 +0000 | [diff] [blame] | 73 | |
| 74 | while(1) { |
| 75 | ek_run(); |
| 76 | } |
adamdunkels | d9ae56d | 2003-04-11 20:29:28 +0000 | [diff] [blame] | 77 | |
| 78 | clrscr(); |
| 79 | |
| 80 | return 0; |
adamdunkels | d9ae56d | 2003-04-11 20:29:28 +0000 | [diff] [blame] | 81 | } |
| 82 | /*-----------------------------------------------------------------------------------*/ |