Added missing includes and made Ethernut 1 & 2 ports to compile again

This commit is contained in:
adamdunkels 2006-06-20 21:23:09 +00:00
parent 7100179654
commit 62e32d2b23
6 changed files with 61 additions and 17 deletions

View file

@ -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 ### Check if we are running under Windows
@ -84,7 +84,7 @@ $(OBJECTDIR)/%.o: %.c
$(STRIP) --strip-unneeded -g -x $@ $(STRIP) --strip-unneeded -g -x $@
%.co: %.c %.co: %.c
$(CC) $(CFLAGS) -DPROCESS_LOADABLE -c $< -o $@ $(CC) $(CFLAGS) -DAUTOSTART_ENABLE -c $< -o $@
%-stripped.o: %.o %-stripped.o: %.o
$(STRIP) --strip-unneeded -g -x -o $@ $< $(STRIP) --strip-unneeded -g -x -o $@ $<
@ -92,8 +92,8 @@ $(OBJECTDIR)/%.o: %.c
%.o: ${CONTIKI_TARGET}/loader/%.S %.o: ${CONTIKI_TARGET}/loader/%.S
$(AS) -o $(notdir $(<:.S=.o)) $< $(AS) -o $(notdir $(<:.S=.o)) $<
%: %.o $(CONTIKI_TARGET_MAIN) $(PROJECT_OBJECTFILES) contiki-$(TARGET).a # %: %.o $(CONTIKI_TARGET_MAIN) $(PROJECT_OBJECTFILES) contiki-$(TARGET).a
$(CC) $(LDFLAGS) $(CFLAGS) -o $@.$(TARGET) $(filter-out %.a,$^) $(filter %.a,$^) # $(CC) $(LDFLAGS) $(CFLAGS) -o $@.$(TARGET) $(filter-out %.a,$^) $(filter %.a,$^)
%.srec: %.$(TARGET) %.srec: %.$(TARGET)
$(OBJCOPY) -O srec $< $@ $(OBJCOPY) -O srec $< $@

44
cpu/avr/mtarch.h Normal file
View file

@ -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__ */

View file

@ -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 all: core
upload: core core.u upload: core core.u
@ -11,6 +11,7 @@ core:
CONTIKI=../.. CONTIKI=../..
TARGET=esb TARGET=esb
blinker.cm: blinker.co blinker2.co
ifdef ENABLE_BACNET ifdef ENABLE_BACNET
APPS += bacnet APPS += bacnet

View file

@ -1,14 +1,14 @@
CONTIKI_TARGET_DIRS = . dev apps net loader CONTIKI_TARGET_DIRS = . dev apps net loader
CONTIKI_TARGET_MAIN = ethernut-main.o 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 rtl8019-drv.c rtl8019.c rtl8019dev.c debug.c delay.c
CONTIKIAVR=$(CONTIKI)/cpu/avr CONTIKIAVR=$(CONTIKI)/cpu/avr
CONTIKIBOARD=. CONTIKIBOARD=.
APPS+=webserver telnetd #program-handler shell APPS+=webserver telnetd #program-handler shell
MCU=atmega128
include $(CONTIKIAVR)/Makefile.avr include $(CONTIKIAVR)/Makefile.avr
%.u: %.$(TARGET) %.u: %.$(TARGET)

View file

@ -29,24 +29,21 @@
* *
* This file is part of the Contiki OS * 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.h"
#include "contiki-net.h" #include "contiki-net.h"
#include "webserver-nogui.h"
#include "telnetd.h"
#include "dev/rs232.h"
#include "dev/rtl8019-drv.h" #include "dev/rtl8019-drv.h"
#include <avr/signal.h>
#include <avr/io.h>
#include <avr/interrupt.h> #include <avr/interrupt.h>
#include <avr/io.h>
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
PROCINIT(&etimer_process, &tcpip_process, &rtl8019_drv_process, PROCINIT(&etimer_process, &tcpip_process, &rtl8019_drv_process);
&telnetd_process);
static const struct uip_eth_addr ethaddr = {{0x00,0x06,0x98,0x01,0x02,0x29}}; static const struct uip_eth_addr ethaddr = {{0x00,0x06,0x98,0x01,0x02,0x29}};
@ -85,6 +82,8 @@ main(void)
procinit_init(); procinit_init();
autostart_start((struct process **) autostart_processes);
rs232_print("Initialized\n"); rs232_print("Initialized\n");
while(1) { while(1) {
@ -94,8 +93,9 @@ main(void)
return 0; return 0;
} }
void int
putchar(int c) putchar(int c)
{ {
rs232_send(c); rs232_send(c);
return c;
} }

View file

@ -29,7 +29,7 @@
* *
* This file is part of the Contiki OS * 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/serial.h"
#include "dev/slip.h" #include "dev/slip.h"
#include "dev/rs232.h" #include "dev/rs232.h"
#include "telnetd.h"
#include <avr/interrupt.h> #include <avr/interrupt.h>
/*static void setup_xram(void) __attribute__ ((naked)) \ /*static void setup_xram(void) __attribute__ ((naked)) \