From 14a8cf720090b98b16e73f792011e98c5576249b Mon Sep 17 00:00:00 2001 From: oliverschmidt Date: Sun, 23 Dec 2007 12:33:57 +0000 Subject: [PATCH] Made use of the new high-level config macros. --- cpu/6502/lib/config.c | 8 +++++--- platform/apple2enh/contiki-main.c | 17 ++++++++++++++++- platform/c64/contiki-main.c | 20 +++++++++++++++++--- 3 files changed, 38 insertions(+), 7 deletions(-) diff --git a/cpu/6502/lib/config.c b/cpu/6502/lib/config.c index 2e99ec510..8cb192d0a 100644 --- a/cpu/6502/lib/config.c +++ b/cpu/6502/lib/config.c @@ -30,7 +30,7 @@ * * Author: Oliver Schmidt * - * $Id: config.c,v 1.5 2007/12/21 01:04:29 oliverschmidt Exp $ + * $Id: config.c,v 1.6 2007/12/23 12:33:57 oliverschmidt Exp $ */ #include @@ -89,7 +89,7 @@ config_read(char *filename) log_message("IP Address: ", ipaddrtoa(&config.hostaddr, uip_buf)); log_message("Subnet Mask: ", ipaddrtoa(&config.netmask, uip_buf)); log_message("Def. Router: ", ipaddrtoa(&config.draddr, uip_buf)); -//log_message("DNS Server: ", ipaddrtoa(&config.resolvaddr, uip_buf)); + log_message("DNS Server: ", ipaddrtoa(&config.resolvaddr, uip_buf)); log_message("Eth. Driver: ", config.ethernetcfg.name); log_message("Driver Port: $", utoa(config.ethernetcfg.addr, uip_buf, 16)); @@ -97,7 +97,9 @@ config_read(char *filename) uip_sethostaddr(&config.hostaddr); uip_setnetmask(&config.netmask); uip_setdraddr(&config.draddr); -//resolv_conf(&config.resolvaddr); +#if WITH_DNS + resolv_conf(&config.resolvaddr); +#endif /* WITH_DNS */ return &config.ethernetcfg; } diff --git a/platform/apple2enh/contiki-main.c b/platform/apple2enh/contiki-main.c index 18c1bb2db..1eb800644 100644 --- a/platform/apple2enh/contiki-main.c +++ b/platform/apple2enh/contiki-main.c @@ -30,15 +30,30 @@ * * Author: Oliver Schmidt * - * $Id: contiki-main.c,v 1.12 2007/12/16 13:08:09 oliverschmidt Exp $ + * $Id: contiki-main.c,v 1.13 2007/12/23 12:35:38 oliverschmidt Exp $ */ #include "contiki-net.h" +#include "ctk/ctk.h" #include "sys/log.h" #include "lib/config.h" #include "net/ethernet-drv.h" +#if WITH_GUI +#define CTK_PROCESS &ctk_process, +#else /* WITH_GUI */ +#define CTK_PROCESS +#endif /* WITH_GUI */ + +#if WITH_DNS +#define RESOLV_PROCESS &resolv_process, +#else /* WITH_DNS */ +#define RESOLV_PROCESS +#endif /* WITH_DNS */ + PROCINIT(&etimer_process, + CTK_PROCESS + RESOLV_PROCESS &tcpip_process); void clock_update(void); diff --git a/platform/c64/contiki-main.c b/platform/c64/contiki-main.c index 2d56e0687..c2dd36c5b 100644 --- a/platform/c64/contiki-main.c +++ b/platform/c64/contiki-main.c @@ -30,7 +30,7 @@ * * Author: Oliver Schmidt * - * $Id: contiki-main.c,v 1.13 2007/12/20 22:54:22 oliverschmidt Exp $ + * $Id: contiki-main.c,v 1.14 2007/12/23 12:35:03 oliverschmidt Exp $ */ #include @@ -41,7 +41,21 @@ #include "lib/config.h" #include "net/ethernet-drv.h" +#if WITH_GUI +#define CTK_PROCESS &ctk_process, +#else /* WITH_GUI */ +#define CTK_PROCESS +#endif /* WITH_GUI */ + +#if WITH_DNS +#define RESOLV_PROCESS &resolv_process, +#else /* WITH_DNS */ +#define RESOLV_PROCESS +#endif /* WITH_DNS */ + PROCINIT(&etimer_process, + CTK_PROCESS + RESOLV_PROCESS &tcpip_process); /*-----------------------------------------------------------------------------------*/ @@ -106,7 +120,7 @@ main(void) process_start((struct process *)ðernet_process, (char *)ethernet_config); -#if CTK_CONF_MOUSE_SUPPORT +#if (WITH_GUI && WITH_MOUSE) { static const u8_t mouse_sprite[64] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -121,7 +135,7 @@ main(void) memcpy((void*)0x0340, mouse_sprite, sizeof(mouse_sprite)); *(u8_t*)0x07F8 = 0x0340 / 64; } -#endif /* CTK_CONF_MOUSE_SUPPORT */ +#endif /* WITH_GUI && WITH_MOUSE */ log_message("Contiki up and running ...", "");