mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
modified and cleaned some files to build RIOT for chronos
This commit is contained in:
parent
0de960b038
commit
212d840a1f
@ -13,6 +13,10 @@ ifeq ($(BOARD),msb-430h)
|
|||||||
INCLUDES += -I$(RIOTBOARD)/msb-430-common/include/
|
INCLUDES += -I$(RIOTBOARD)/msb-430-common/include/
|
||||||
INCLUDES += -I$(RIOTBOARD)/msb-430-common/drivers/include/
|
INCLUDES += -I$(RIOTBOARD)/msb-430-common/drivers/include/
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(BOARD),chronos)
|
||||||
|
INCLUDES += -I$(RIOTBOARD)/chronos/include/
|
||||||
|
INCLUDES += -I$(RIOTBOARD)/chronos/drivers/include/
|
||||||
|
endif
|
||||||
ifeq ($(BOARD),native)
|
ifeq ($(BOARD),native)
|
||||||
INCLUDES += -I$(RIOTBOARD)/native/include/
|
INCLUDES += -I$(RIOTBOARD)/native/include/
|
||||||
endif
|
endif
|
||||||
|
@ -4,12 +4,12 @@ OBJ = $(SRC:%.c=$(BINDIR)%.o)## defines
|
|||||||
|
|
||||||
DEP = $(SRC:%.c=$(BINDIR)%.d)
|
DEP = $(SRC:%.c=$(BINDIR)%.d)
|
||||||
|
|
||||||
INCLUDES = -Iinclude -I../../feuerware-base/sys/lib -I../../feuerware-base/sys/drivers/include
|
INCLUDES += -Iinclude -I$(RIOTBASE)/sys/lib -I$(RIOTBASE)/sys/drivers/include
|
||||||
INCLUDES += -I../../feuerware-base/sys/drivers/cc110x_ng/include
|
INCLUDES += -I$(RIOTBASE)/sys/drivers/cc110x_ng/include
|
||||||
INCLUDES += -I../../feuerware-base/core/include
|
INCLUDES += -I$(RIOTBASE)/core/include
|
||||||
INCLUDES += -I../../feuerware-base/cpu/msp430/include/
|
INCLUDES += -I$(RIOTBASE)/cpu/msp430-common/include/
|
||||||
INCLUDES += -I../../feuerware-base/cpu/cc430/include/
|
INCLUDES += -I$(RIOTBASE)/cpu/cc430/include/
|
||||||
INCLUDES += -I/usr/msp430/include/
|
#INCLUDES += -I/usr/msp430/include/
|
||||||
|
|
||||||
all: $(BINDIR)chronos_base.a
|
all: $(BINDIR)chronos_base.a
|
||||||
$(MAKE) -C drivers
|
$(MAKE) -C drivers
|
||||||
|
21
chronos/Makefile.include
Normal file
21
chronos/Makefile.include
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
## the cpu to build for
|
||||||
|
export CPU = cc430
|
||||||
|
export MCU = cc430f6137
|
||||||
|
|
||||||
|
# toolchain config
|
||||||
|
export PREFIX = @msp430-
|
||||||
|
export CC = @$(PREFIX)gcc
|
||||||
|
export AR = @$(PREFIX)ar
|
||||||
|
export CFLAGS += -std=gnu99 -Wstrict-prototypes -gdwarf-2 -Os -Wall -mmcu=$(MCU) -D CC430
|
||||||
|
export ASFLAGS += -mmcu=$(MCU) --defsym $(MCU)=1 --gdwarf-2
|
||||||
|
export AS = $(PREFIX)as
|
||||||
|
export LINK = $(PREFIX)gcc
|
||||||
|
export SIZE = $(PREFIX)size
|
||||||
|
export OBJCOPY = $(PREFIX)objcopy
|
||||||
|
export LINKFLAGS = -mmcu=$(MCU) -lgcc $(RIOTBASE)/bin/startup.o
|
||||||
|
export FLASHER = mspdebug
|
||||||
|
ifeq ($(strip $(PORT)),)
|
||||||
|
export PORT = /dev/ttyUSB0
|
||||||
|
endif
|
||||||
|
export HEXFILE = bin/$(PROJECT).hex
|
||||||
|
export FFLAGS = -d $(PORT) -j uif "prog $(HEXFILE)"
|
@ -69,6 +69,6 @@ void cc430_cpu_init(void) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void board_init() {
|
void board_init(void) {
|
||||||
cc430_cpu_init();
|
cc430_cpu_init();
|
||||||
}
|
}
|
||||||
|
24
chronos/drivers/Makefile
Normal file
24
chronos/drivers/Makefile
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
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/
|
||||||
|
|
||||||
|
$(BINDIR)chronos_drivers.a: $(OBJ)
|
||||||
|
$(AR) rcs $(BINDIR)chronos_base.a $(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)
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <cc430x613x.h>
|
#include <cc430f6137.h>
|
||||||
#include <cc430-adc.h>
|
#include <cc430-adc.h>
|
||||||
|
|
||||||
uint32_t battery_get_voltage(void) {
|
uint32_t battery_get_voltage(void) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <buzzer.h>
|
#include <buzzer.h>
|
||||||
#include <hwtimer.h>
|
#include <hwtimer.h>
|
||||||
#include <cc430x613x.h>
|
#include <cc430f6137.h>
|
||||||
|
|
||||||
void buzzer_beep(uint8_t pitch, uint16_t duration) {
|
void buzzer_beep(uint8_t pitch, uint16_t duration) {
|
||||||
// Reset TA1R, set up mode, TA1 runs from 32768Hz ACLK
|
// Reset TA1R, set up mode, TA1 runs from 32768Hz ACLK
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include <cc110x-arch.h>
|
#include <cc110x-arch.h>
|
||||||
|
|
||||||
//#include <cc430_.h>
|
//#include <cc430_.h>
|
||||||
#include <cc430x613x.h>
|
#include <cc430f6137.h>
|
||||||
//#include <msp430/rf1a.h>
|
//#include <msp430/rf1a.h>
|
||||||
|
|
||||||
#define CC1100_GDO0 (RF1AIN & BIT0)
|
#define CC1100_GDO0 (RF1AIN & BIT0)
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
/* driver */
|
/* driver */
|
||||||
#include <cc430x613x.h>
|
#include <cc430f6137.h>
|
||||||
#include <display.h>
|
#include <display.h>
|
||||||
|
|
||||||
|
|
||||||
|
@ -38,7 +38,8 @@
|
|||||||
|
|
||||||
/* ************************************************************************************************* */
|
/* ************************************************************************************************* */
|
||||||
/* Include section */
|
/* Include section */
|
||||||
#include <cc430x613x.h>
|
#include <stdint.h>
|
||||||
|
#include <cc430f6137.h>
|
||||||
#include <display.h>
|
#include <display.h>
|
||||||
|
|
||||||
/* ************************************************************************************************* */
|
/* ************************************************************************************************* */
|
||||||
|
@ -7,9 +7,9 @@ extern void (*_putchar)(int c);
|
|||||||
|
|
||||||
static char display_buf[11];
|
static char display_buf[11];
|
||||||
|
|
||||||
void putchar_to_display();
|
void putchar_to_display(int c);
|
||||||
|
|
||||||
void init_display_putchar() {
|
void init_display_putchar(void) {
|
||||||
memset(display_buf, '\0', 11);
|
memset(display_buf, '\0', 11);
|
||||||
_putchar = putchar_to_display;
|
_putchar = putchar_to_display;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#ifndef __DISPLAY_PUTCHAR_H
|
#ifndef __DISPLAY_PUTCHAR_H
|
||||||
#define __DISPLAY_PUTCHAR_H
|
#define __DISPLAY_PUTCHAR_H
|
||||||
|
|
||||||
void init_display_putchar();
|
void init_display_putchar(void);
|
||||||
|
|
||||||
#endif /* __DISPLAY_PUTCHAR_H */
|
#endif /* __DISPLAY_PUTCHAR_H */
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#ifndef _MSB_BOARD_H
|
#ifndef _MSB_BOARD_H
|
||||||
#define _MSB_BOARD_H
|
#define _MSB_BOARD_H
|
||||||
|
|
||||||
#include <cc430x613x.h>
|
#include <cc430f6137.h>
|
||||||
|
|
||||||
#define MSP430_INITIAL_CPU_SPEED 7372800uL
|
#define MSP430_INITIAL_CPU_SPEED 7372800uL
|
||||||
#define MSP430_HAS_DCOR 1
|
#define MSP430_HAS_DCOR 1
|
||||||
|
Loading…
Reference in New Issue
Block a user