mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
* initial commit for yet not working redbee support
This commit is contained in:
parent
b0d9e4f86f
commit
a9caa84826
26
redbee-econotag/Makefile
Normal file
26
redbee-econotag/Makefile
Normal file
@ -0,0 +1,26 @@
|
||||
SRC = $(wildcard *.c)
|
||||
BINDIR = $(RIOTBOARD)/$(BOARD)/bin/
|
||||
OBJ = $(SRC:%.c=$(BINDIR)%.o)## defines
|
||||
DEP = $(SRC:%.c=$(BINDIR)%.d)
|
||||
export ARCH = redbee-econotag_base.a
|
||||
|
||||
all: $(BINDIR)$(ARCH)
|
||||
$(MAKE) -C drivers
|
||||
|
||||
$(BINDIR)$(ARCH): $(OBJ)
|
||||
$(AR) rcs $(BINDIR)$(ARCH) $(OBJ)
|
||||
|
||||
# pull in dependency info for *existing* .o files
|
||||
-include $(OBJ:.o=.d)
|
||||
|
||||
# compile and generate dependency info
|
||||
$(BINDIR)%.o: %.c
|
||||
$(CC) $(CFLAGS) $(INCLUDES) $(BOARDINCLUDE) $(PROJECTINCLUDE) $(CPUINCLUDE) -c $*.c -o $(BINDIR)$*.o
|
||||
$(CC) $(CFLAGS) $(INCLUDES) $(BOARDINCLUDE) $(PROJECTINCLUDE) $(CPUINCLUDE) -MM $*.c > $(BINDIR)$*.d
|
||||
@printf "$(BINDIR)"|cat - $(BINDIR)$*.d > /tmp/riot_out && mv /tmp/riot_out $(BINDIR)$*.d
|
||||
|
||||
# remove compilation products
|
||||
clean:
|
||||
${MAKE} -C drivers clean
|
||||
rm -f $(OBJ) $(DEP)
|
||||
|
0
redbee-econotag/Makefile.dep
Normal file
0
redbee-econotag/Makefile.dep
Normal file
27
redbee-econotag/Makefile.include
Normal file
27
redbee-econotag/Makefile.include
Normal file
@ -0,0 +1,27 @@
|
||||
## the cpu to build for
|
||||
export CPU = mc1322x
|
||||
|
||||
# toolchain config
|
||||
export PREFIX = @arm-none-eabi-
|
||||
export CC = @$(PREFIX)gcc
|
||||
export AR = @$(PREFIX)ar
|
||||
export CFLAGS = -std=gnu99 -march=armv4t -mtune=arm7tdmi-s -mlong-calls \
|
||||
-msoft-float -mthumb-interwork -fno-strict-aliasing -fno-common \
|
||||
-ffixed-r8 -ffunction-sections -ffreestanding -fno-builtin \
|
||||
-nodefaultlibs -Wcast-align -Wall -Wstrict-prototypes -Wextra \
|
||||
-Os -pipe
|
||||
$(warning TODO add -mthumb)
|
||||
export AFLAGS = -Wa,-gstabs $(CFLAGS)
|
||||
export AS = $(PREFIX)as
|
||||
export LINK = $(PREFIX)gcc
|
||||
export SIZE = $(PREFIX)size
|
||||
export OBJCOPY = $(PREFIX)objcopy
|
||||
FLASHER = lpc2k_pgm
|
||||
TERM = pyterm.py
|
||||
LINKFLAGS = -mcpu=arm7tdmi-s -static -lgcc -nostartfiles -T$(RIOTBASE)/cpu/$(CPU)/mc1322x.lds
|
||||
|
||||
ifeq ($(strip $(PORT)),)
|
||||
export PORT = /dev/ttyUSB0
|
||||
endif
|
||||
export HEXFILE = bin/$(PROJECT).hex
|
||||
export FFLAGS = -d $(PORT) -j uif "prog $(HEXFILE)"
|
11
redbee-econotag/board_init.c
Normal file
11
redbee-econotag/board_init.c
Normal file
@ -0,0 +1,11 @@
|
||||
/*
|
||||
* board_init.c - redbee-econotag initialization code
|
||||
* Copyright (C) 2013 Oliver Hahm <oliver.hahm@inria.fr>
|
||||
*
|
||||
* This source code is licensed under the GNU General Public License,
|
||||
* Version 3. See the file LICENSE for more details.
|
||||
*/
|
||||
|
||||
void board_init(void) {
|
||||
asm("nop");
|
||||
}
|
26
redbee-econotag/drivers/Makefile
Normal file
26
redbee-econotag/drivers/Makefile
Normal file
@ -0,0 +1,26 @@
|
||||
SRC = $(wildcard *.c)
|
||||
BINDIR = $(RIOTBOARD)/$(BOARD)/bin/
|
||||
OBJ = $(SRC:%.c=$(BINDIR)%.o)
|
||||
DEP = $(SRC:%.c=$(BINDIR)%.d)
|
||||
|
||||
INCLUDES += -I$(RIOTBASE)/sys/include/ -I$(RIOTBASE)/drivers/cc110x_ng/include/
|
||||
|
||||
.PHONY: redbee-econotag_drivers.a
|
||||
|
||||
$(BINDIR)redbee-econotag_common_drivers.a: $(OBJ)
|
||||
$(AR) rcs $(BINDIR)$(ARCH) $(OBJ)
|
||||
|
||||
# pull in dependency info for *existing* .o files
|
||||
-include $(OBJ:.o=.d)
|
||||
|
||||
# compile and generate dependency info
|
||||
$(BINDIR)%.o: %.c
|
||||
$(CC) $(CFLAGS) $(INCLUDES) $(BOARDINCLUDE) $(PROJECTINCLUDE) $(CPUINCLUDE) -c $*.c -o $(BINDIR)$*.o
|
||||
$(CC) $(CFLAGS) $(INCLUDES) $(BOARDINCLUDE) $(PROJECTINCLUDE) $(CPUINCLUDE) -MM $*.c > $(BINDIR)$*.d
|
||||
@printf "$(BINDIR)" | cat - $(BINDIR)$*.d > /tmp/riot_out && mv /tmp/riot_out $(BINDIR)$*.d
|
||||
|
||||
# remove compilation products
|
||||
|
||||
clean:
|
||||
rm -f $(OBJ) $(DEP)
|
||||
|
43
redbee-econotag/drivers/redbee_uart1.c
Normal file
43
redbee-econotag/drivers/redbee_uart1.c
Normal file
@ -0,0 +1,43 @@
|
||||
/*
|
||||
* redbee_uart1.c - UART1 driver for redbee
|
||||
* Copyright (C) 2013 Oliver Hahm <oliver.hahm@inria.fr>
|
||||
*
|
||||
* This source code is licensed under the GNU General Public License,
|
||||
* Version 3. See the file LICENSE for more details.
|
||||
*
|
||||
* This file is part of RIOT.
|
||||
*/
|
||||
|
||||
#include "mc1322x.h"
|
||||
|
||||
static volatile unsigned int running = 0;
|
||||
static volatile unsigned int fifo = 0;
|
||||
|
||||
static inline int uart0_puts(char *astring, int length)
|
||||
{
|
||||
int i;
|
||||
for (i=0;i<length;i++) {
|
||||
/* TODO: Fix me */
|
||||
while(UART1->TXCON != 0);
|
||||
UART1->DATA = astring[i];
|
||||
}
|
||||
return length;
|
||||
}
|
||||
|
||||
int fw_puts(char *astring, int length)
|
||||
{
|
||||
return uart0_puts(astring, length);
|
||||
}
|
||||
|
||||
void stdio_flush(void)
|
||||
{
|
||||
/* disable TX interrupt */
|
||||
UART1->CONbits.MTXR = 1;
|
||||
while(running) {
|
||||
while(UART1->TXCON != 0);
|
||||
fifo=0;
|
||||
push_queue(); // dequeue to fifo
|
||||
}
|
||||
/* enable TX interrupt */
|
||||
UART1->CONbits.MTXR = 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user