gpz | 452b5bd | 2003-05-19 08:21:01 +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. |
| 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 | * |
| 35 | * $Id: contiki-main.c,v 1.1 2003/05/19 08:21:02 gpz Exp $ |
| 36 | * |
| 37 | */ |
| 38 | |
| 39 | #include "ctk.h" |
| 40 | #include "ctk-draw.h" |
| 41 | #include "dispatcher.h" |
| 42 | |
| 43 | #include "simpletelnet.h" |
| 44 | #include "programs.h" |
| 45 | #include "email.h" |
| 46 | #include "www.h" |
| 47 | #include "contiki.h" |
| 48 | |
| 49 | #include "uip_main.h" |
| 50 | #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 | #include <time.h> |
| 58 | #include <stdio.h> |
| 59 | #include <conio.h> |
| 60 | //#include <rs232.h> |
| 61 | #include <time.h> |
| 62 | #include <string.h> |
| 63 | |
| 64 | |
| 65 | /*-----------------------------------------------------------------------------------*/ |
| 66 | int |
| 67 | main(int argc, char **argv) |
| 68 | { |
| 69 | /* irqload_init();*/ |
| 70 | |
| 71 | #ifdef WITH_UIP |
| 72 | uip_init(); |
| 73 | uip_main_init(); |
| 74 | resolv_init(); |
| 75 | |
| 76 | #ifdef WITH_TFE |
| 77 | cs8900a_init(); |
| 78 | #endif /* WITH_TFE */ |
| 79 | |
| 80 | |
| 81 | #ifdef WITH_RS232 |
| 82 | rs232dev_init(); |
| 83 | #endif /* WITH_RS232 */ |
| 84 | |
| 85 | #ifdef WITH_TAPDEV |
| 86 | tapdev_init(); |
| 87 | #endif /* WITH_TAPDEV */ |
| 88 | |
| 89 | |
| 90 | #endif /* WITH_UIP */ |
| 91 | |
| 92 | |
| 93 | conio_init(); |
| 94 | #if 0 |
| 95 | { |
| 96 | int i,j; |
| 97 | clrscr(); |
| 98 | textcolor(0);bgcolor(1); |
| 99 | while(1) |
| 100 | { |
| 101 | gotoxy(0,0); |
| 102 | cprintf("%d\n\r",i++); |
| 103 | //conio_update(); |
| 104 | |
| 105 | if(kbhit()) |
| 106 | { |
| 107 | cprintf(" "); |
| 108 | cprintf("%02x",cgetc()); |
| 109 | cprintf("\n\r"); |
| 110 | } |
| 111 | else |
| 112 | { |
| 113 | cprintf("pressed: ---------\n\r"); |
| 114 | } |
| 115 | |
| 116 | j=joy_read(0); |
| 117 | cprintf("%08x\n\r",j); |
| 118 | } |
| 119 | } |
| 120 | #endif |
| 121 | |
| 122 | ek_init(); |
| 123 | dispatcher_init(); |
| 124 | ctk_init(); |
| 125 | |
| 126 | contiki_init(); |
| 127 | |
| 128 | programs_init(); |
| 129 | |
| 130 | ctk_redraw(); |
| 131 | ek_run(); |
| 132 | |
| 133 | clrscr(); |
| 134 | |
| 135 | return 0; |
| 136 | |
| 137 | argv = argv; |
| 138 | argc = argc; |
| 139 | } |
| 140 | /*-----------------------------------------------------------------------------------*/ |
| 141 | |
| 142 | //#include "gb.c" |