adamdunkels | 7e4982c | 2003-03-19 16:26:18 +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 | * |
adamdunkels | 0a08fda | 2004-07-04 18:33:07 +0000 | [diff] [blame^] | 35 | * $Id: main.c,v 1.10 2004/07/04 18:33:07 adamdunkels Exp $ |
adamdunkels | 7e4982c | 2003-03-19 16:26:18 +0000 | [diff] [blame] | 36 | * |
| 37 | */ |
| 38 | |
| 39 | #include "ctk.h" |
| 40 | #include "ctk-draw.h" |
adamdunkels | 0a08fda | 2004-07-04 18:33:07 +0000 | [diff] [blame^] | 41 | #include "ek.h" |
adamdunkels | 7e4982c | 2003-03-19 16:26:18 +0000 | [diff] [blame] | 42 | |
adamdunkels | 80d1db0 | 2003-04-08 19:11:19 +0000 | [diff] [blame] | 43 | #include "program-handler.h" |
adamdunkels | 7e4982c | 2003-03-19 16:26:18 +0000 | [diff] [blame] | 44 | |
adamdunkels | fcd7b48 | 2004-02-24 09:52:54 +0000 | [diff] [blame] | 45 | |
adamdunkels | eeb5edd | 2003-04-25 08:45:59 +0000 | [diff] [blame] | 46 | #include "uip-signal.h" |
adamdunkels | 7e4982c | 2003-03-19 16:26:18 +0000 | [diff] [blame] | 47 | #include "uip.h" |
| 48 | #include "uip_arp.h" |
adamdunkels | 7e4982c | 2003-03-19 16:26:18 +0000 | [diff] [blame] | 49 | |
adamdunkels | 7cde609 | 2003-08-24 22:35:22 +0000 | [diff] [blame] | 50 | #include "resolv.h" |
| 51 | |
adamdunkels | 243e1f7 | 2003-08-06 23:13:06 +0000 | [diff] [blame] | 52 | #include "configedit-dsc.h" |
adamdunkels | b410708 | 2003-04-18 00:13:42 +0000 | [diff] [blame] | 53 | #include "directory-dsc.h" |
adamdunkels | d4d6dde | 2003-08-05 13:54:50 +0000 | [diff] [blame] | 54 | #include "processes-dsc.h" |
adamdunkels | 179f718 | 2003-04-17 18:59:05 +0000 | [diff] [blame] | 55 | |
adamdunkels | 36a8128 | 2003-08-04 00:14:03 +0000 | [diff] [blame] | 56 | #include "c64-dio.h" |
| 57 | |
adamdunkels | 0a08fda | 2004-07-04 18:33:07 +0000 | [diff] [blame^] | 58 | #include "clock.h" |
| 59 | |
adamdunkels | 36a8128 | 2003-08-04 00:14:03 +0000 | [diff] [blame] | 60 | #include <cbm.h> |
| 61 | |
adamdunkels | 0a08fda | 2004-07-04 18:33:07 +0000 | [diff] [blame^] | 62 | unsigned char |
| 63 | uip_fw_forward(void) |
| 64 | { |
| 65 | return 0; |
| 66 | } |
| 67 | void |
| 68 | uip_fw_periodic(void) |
| 69 | { |
| 70 | return; |
| 71 | } |
adamdunkels | 7e4982c | 2003-03-19 16:26:18 +0000 | [diff] [blame] | 72 | /*-----------------------------------------------------------------------------------*/ |
adamdunkels | 0a08fda | 2004-07-04 18:33:07 +0000 | [diff] [blame^] | 73 | clock_time_t |
| 74 | clock_time(void) |
adamdunkels | 7cdff29 | 2004-02-16 21:21:46 +0000 | [diff] [blame] | 75 | { |
| 76 | return clock(); |
| 77 | } |
| 78 | /*-----------------------------------------------------------------------------------*/ |
adamdunkels | b082c09 | 2004-06-08 11:47:18 +0000 | [diff] [blame] | 79 | void |
| 80 | main(void) |
adamdunkels | 7e4982c | 2003-03-19 16:26:18 +0000 | [diff] [blame] | 81 | { |
adamdunkels | 7e4982c | 2003-03-19 16:26:18 +0000 | [diff] [blame] | 82 | |
adamdunkels | 36a8128 | 2003-08-04 00:14:03 +0000 | [diff] [blame] | 83 | c64_dio_init(_curunit); |
| 84 | |
adamdunkels | 0a08fda | 2004-07-04 18:33:07 +0000 | [diff] [blame^] | 85 | ek_init(); |
| 86 | tcpip_init(NULL); |
adamdunkels | b12160f | 2003-08-13 22:48:55 +0000 | [diff] [blame] | 87 | |
adamdunkels | 7e4982c | 2003-03-19 16:26:18 +0000 | [diff] [blame] | 88 | ctk_init(); |
adamdunkels | 243e1f7 | 2003-08-06 23:13:06 +0000 | [diff] [blame] | 89 | |
adamdunkels | fcd7b48 | 2004-02-24 09:52:54 +0000 | [diff] [blame] | 90 | resolv_init(NULL); |
adamdunkels | b12160f | 2003-08-13 22:48:55 +0000 | [diff] [blame] | 91 | |
adamdunkels | 0a08fda | 2004-07-04 18:33:07 +0000 | [diff] [blame^] | 92 | uip_event_init(); |
adamdunkels | 243e1f7 | 2003-08-06 23:13:06 +0000 | [diff] [blame] | 93 | |
adamdunkels | 80d1db0 | 2003-04-08 19:11:19 +0000 | [diff] [blame] | 94 | program_handler_init(); |
adamdunkels | 0b9424e | 2003-07-30 23:11:47 +0000 | [diff] [blame] | 95 | |
adamdunkels | b410708 | 2003-04-18 00:13:42 +0000 | [diff] [blame] | 96 | program_handler_add(&directory_dsc, "Directory", 1); |
adamdunkels | 243e1f7 | 2003-08-06 23:13:06 +0000 | [diff] [blame] | 97 | program_handler_add(&configedit_dsc, "Configuration", 1); |
adamdunkels | d4d6dde | 2003-08-05 13:54:50 +0000 | [diff] [blame] | 98 | program_handler_add(&processes_dsc, "Processes", 1); |
adamdunkels | 0b9424e | 2003-07-30 23:11:47 +0000 | [diff] [blame] | 99 | |
adamdunkels | 7cde609 | 2003-08-24 22:35:22 +0000 | [diff] [blame] | 100 | program_handler_load("config.prg", NULL); |
adamdunkels | 0a08fda | 2004-07-04 18:33:07 +0000 | [diff] [blame^] | 101 | |
| 102 | while(1) { |
| 103 | ek_run(); |
| 104 | } |
adamdunkels | 7e4982c | 2003-03-19 16:26:18 +0000 | [diff] [blame] | 105 | |
adamdunkels | 7e4982c | 2003-03-19 16:26:18 +0000 | [diff] [blame] | 106 | } |
| 107 | /*-----------------------------------------------------------------------------------*/ |