From 62e32d2b23dfb04e9f44351c5e5177ea9e4c8566 Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Tue, 20 Jun 2006 21:23:09 +0000 Subject: [PATCH] Added missing includes and made Ethernut 1 & 2 ports to compile again --- cpu/avr/Makefile.avr | 8 ++--- cpu/avr/mtarch.h | 44 +++++++++++++++++++++++++++ platform/esb/Makefile | 3 +- platform/ethernut1/Makefile.ethernut1 | 4 +-- platform/ethernut1/ethernut-main.c | 16 +++++----- platform/ethernut2/ethernut-main.c | 3 +- 6 files changed, 61 insertions(+), 17 deletions(-) create mode 100644 cpu/avr/mtarch.h diff --git a/cpu/avr/Makefile.avr b/cpu/avr/Makefile.avr index 75336ee2d..8ec26a503 100644 --- a/cpu/avr/Makefile.avr +++ b/cpu/avr/Makefile.avr @@ -1,4 +1,4 @@ -# $Id: Makefile.avr,v 1.1 2006/06/18 07:44:59 adamdunkels Exp $ +# $Id: Makefile.avr,v 1.2 2006/06/20 21:23:09 adamdunkels Exp $ ### Check if we are running under Windows @@ -84,7 +84,7 @@ $(OBJECTDIR)/%.o: %.c $(STRIP) --strip-unneeded -g -x $@ %.co: %.c - $(CC) $(CFLAGS) -DPROCESS_LOADABLE -c $< -o $@ + $(CC) $(CFLAGS) -DAUTOSTART_ENABLE -c $< -o $@ %-stripped.o: %.o $(STRIP) --strip-unneeded -g -x -o $@ $< @@ -92,8 +92,8 @@ $(OBJECTDIR)/%.o: %.c %.o: ${CONTIKI_TARGET}/loader/%.S $(AS) -o $(notdir $(<:.S=.o)) $< -%: %.o $(CONTIKI_TARGET_MAIN) $(PROJECT_OBJECTFILES) contiki-$(TARGET).a - $(CC) $(LDFLAGS) $(CFLAGS) -o $@.$(TARGET) $(filter-out %.a,$^) $(filter %.a,$^) +# %: %.o $(CONTIKI_TARGET_MAIN) $(PROJECT_OBJECTFILES) contiki-$(TARGET).a +# $(CC) $(LDFLAGS) $(CFLAGS) -o $@.$(TARGET) $(filter-out %.a,$^) $(filter %.a,$^) %.srec: %.$(TARGET) $(OBJCOPY) -O srec $< $@ diff --git a/cpu/avr/mtarch.h b/cpu/avr/mtarch.h new file mode 100644 index 000000000..8b46fd786 --- /dev/null +++ b/cpu/avr/mtarch.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2005, Swedish Institute of Computer Science + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * This file is part of the Contiki operating system. + * + * @(#)$Id: mtarch.h,v 1.1 2006/06/20 21:23:09 adamdunkels Exp $ + */ +#ifndef __MTARCH_H__ +#define __MTARCH_H__ + +#define MTARCH_STACKSIZE 64 + +struct mtarch_thread { + unsigned short stack[MTARCH_STACKSIZE]; + unsigned short *sp; +}; + +#endif /* __MTARCH_H__ */ + diff --git a/platform/esb/Makefile b/platform/esb/Makefile index d813e69a4..367ce2d95 100644 --- a/platform/esb/Makefile +++ b/platform/esb/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.1 2006/06/18 05:54:28 adamdunkels Exp $ +# $Id: Makefile,v 1.2 2006/06/20 21:23:10 adamdunkels Exp $ all: core upload: core core.u @@ -11,6 +11,7 @@ core: CONTIKI=../.. TARGET=esb +blinker.cm: blinker.co blinker2.co ifdef ENABLE_BACNET APPS += bacnet diff --git a/platform/ethernut1/Makefile.ethernut1 b/platform/ethernut1/Makefile.ethernut1 index 6a85eb58a..8c88c0dc9 100644 --- a/platform/ethernut1/Makefile.ethernut1 +++ b/platform/ethernut1/Makefile.ethernut1 @@ -1,14 +1,14 @@ CONTIKI_TARGET_DIRS = . dev apps net loader CONTIKI_TARGET_MAIN = ethernut-main.o -CONTIKI_SOURCEFILES += slip.c rs232.c serial.c ethernut-main.c \ +CONTIKI_TARGET_SOURCEFILES += slip.c rs232.c serial.c ethernut-main.c \ rtl8019-drv.c rtl8019.c rtl8019dev.c debug.c delay.c CONTIKIAVR=$(CONTIKI)/cpu/avr CONTIKIBOARD=. APPS+=webserver telnetd #program-handler shell - +MCU=atmega128 include $(CONTIKIAVR)/Makefile.avr %.u: %.$(TARGET) diff --git a/platform/ethernut1/ethernut-main.c b/platform/ethernut1/ethernut-main.c index b3fa6780c..3716ea883 100644 --- a/platform/ethernut1/ethernut-main.c +++ b/platform/ethernut1/ethernut-main.c @@ -29,24 +29,21 @@ * * This file is part of the Contiki OS * - * $Id: ethernut-main.c,v 1.1 2006/06/17 22:41:28 adamdunkels Exp $ + * $Id: ethernut-main.c,v 1.2 2006/06/20 21:23:10 adamdunkels Exp $ * */ #include "contiki.h" #include "contiki-net.h" -#include "webserver-nogui.h" -#include "telnetd.h" +#include "dev/rs232.h" #include "dev/rtl8019-drv.h" -#include -#include #include +#include #include -PROCINIT(&etimer_process, &tcpip_process, &rtl8019_drv_process, - &telnetd_process); +PROCINIT(&etimer_process, &tcpip_process, &rtl8019_drv_process); static const struct uip_eth_addr ethaddr = {{0x00,0x06,0x98,0x01,0x02,0x29}}; @@ -85,6 +82,8 @@ main(void) procinit_init(); + autostart_start((struct process **) autostart_processes); + rs232_print("Initialized\n"); while(1) { @@ -94,8 +93,9 @@ main(void) return 0; } -void +int putchar(int c) { rs232_send(c); + return c; } diff --git a/platform/ethernut2/ethernut-main.c b/platform/ethernut2/ethernut-main.c index 9226d78a9..2cfb8e98c 100644 --- a/platform/ethernut2/ethernut-main.c +++ b/platform/ethernut2/ethernut-main.c @@ -29,7 +29,7 @@ * * This file is part of the Contiki OS * - * $Id: ethernut-main.c,v 1.1 2006/06/17 22:41:28 adamdunkels Exp $ + * $Id: ethernut-main.c,v 1.2 2006/06/20 21:23:10 adamdunkels Exp $ * */ @@ -38,7 +38,6 @@ #include "dev/serial.h" #include "dev/slip.h" #include "dev/rs232.h" -#include "telnetd.h" #include /*static void setup_xram(void) __attribute__ ((naked)) \