1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

* added missing makefiles for msb430h

* updated some makefiles and fixed includes for msb430h
This commit is contained in:
Oliver Hahm 2013-02-11 22:10:03 +01:00
parent f6e129959e
commit 82f2e3d4e0
15 changed files with 45 additions and 27 deletions

View File

@ -23,7 +23,7 @@
#define ENABLE_DEBUG
#include <debug.h>
//extern void *sbrk(int incr);
extern void *sbrk(int incr);
void *_malloc(size_t size) {
void* ptr = sbrk(size);

View File

@ -10,6 +10,10 @@ ifeq ($(CPU),cc430)
DIRS = msp430 cc430
endif
ifeq ($(CPU),msp430x16x)
DIRS = msp430-common msp430x16x
endif
.PHONY: cpus
.PHONY: $(DIRS)

View File

@ -24,8 +24,8 @@ and the mailinglist (subscription via web site)
scatterweb@lists.spline.inf.fu-berlin.de
*******************************************************************************/
#include <msp430x16x.h>
#include "cpu.h"
#include <board.h>
#include "kernel.h"
#include "kernel_intern.h"
#include "sched.h"
@ -87,7 +87,7 @@ void thread_yield() {
//
// __return_from_isr
void cpu_switch_context_exit(){
void cpu_switch_context_exit(void){
active_thread = sched_threads[0];
sched_run();

View File

@ -27,7 +27,6 @@ and the mailinglist (subscription via web site)
#include <stdint.h>
#include <cpu.h>
#include <board.h>
#include <hwtimer.h>
#include <hwtimer_arch.h>

View File

@ -53,7 +53,7 @@ extern char __isr_stack[MSP430_ISR_STACK_SIZE];
//#define eINT() eint()
//#define dINT() dint()
inline void __save_context_isr() {
inline void __save_context_isr(void) {
__asm__("push r15");
__asm__("push r14");
__asm__("push r13");
@ -70,7 +70,7 @@ inline void __save_context_isr() {
__asm__("mov.w r1,%0" : "=r" (active_thread->sp));
}
inline void __restore_context_isr() {
inline void __restore_context_isr(void) {
__asm__("mov.w %0,r1" : : "m" (active_thread->sp));
__asm__("pop r4");
@ -87,45 +87,45 @@ inline void __restore_context_isr() {
__asm__("pop r15");
}
inline void __enter_isr() {
inline void __enter_isr(void) {
__save_context_isr();
__asm__("mov.w %0,r1" : : "i" (__isr_stack+MSP430_ISR_STACK_SIZE));
__inISR = 1;
}
inline void __exit_isr() {
inline void __exit_isr(void) {
__inISR = 0;
if (sched_context_switch_request) sched_run();
__restore_context_isr();
__asm__("reti");
}
inline void __save_context() {
inline void __save_context(void) {
__asm__("push r2"); /* save SR */
__save_context_isr();
}
inline void __restore_context() {
inline void __restore_context(void) {
__restore_context_isr();
__asm__("reti");
}
inline void eINT() {
inline void eINT(void) {
// puts("+");
eint();
}
inline void dINT() {
inline void dINT(void) {
// puts("-");
dint();
}
#define lpm_set(...)
void thread_yield();
void thread_yield(void);
int inISR();
int inISR(void);
/** @} */
#endif // _CPU_H

View File

@ -27,8 +27,8 @@ and the mailinglist (subscription via web site)
#ifndef __HWTIMER_CPU_H
#define __HWTIMER_CPU_H
#include <msp430x16x.h>
#include <stdint.h>
#include <board.h>
#ifdef __MSP430_HAS_TA2__
#define ARCH_MAXTIMERS 2

View File

@ -49,7 +49,6 @@
#include <stdint.h>
#include <stdbool.h>
#include "board.h"
#ifndef MSP430_INITIAL_CPU_SPEED
@ -88,7 +87,7 @@ void msp430_set_cpu_speed(uint32_t speed);
void msp430_cpu_init(void); /* Rename to cpu_init() later! */
#define cpu_init() msp430_cpu_init()
void msp430_init_dco();
void msp430_init_dco(void);
void *sbrk(int);

View File

@ -1,5 +1,5 @@
#include <irq.h>
#include <board.h>
#include <msp430x16x.h>
#include <cpu.h>
unsigned int disableIRQ() {

View File

@ -1,6 +1,6 @@
MODULE =cpu
INCLUDES = -Iinclude -Idrivers/include -I../arm_common/include -I../../sys/lib -I../../sys/drivers/include -I../../core/include -I../../sys/include -I../../hal/include -I../../..
INCLUDES = -Iinclude -I$(RIOTBASE)/core/include/ -I$(RIOTBOARD)/$(BOARD)/include
DIRS =
all: $(BINDIR)$(MODULE).a

View File

@ -35,7 +35,7 @@
#include <sys/unistd.h>
#include "cpu.h"
#include "board.h"
#include <msp430x16x.h>
#include "msp430.h"
@ -168,5 +168,5 @@ splx_(int sr)
}
/*---------------------------------------------------------------------------*/
extern void board_init();
extern void board_init(void);

View File

@ -1,10 +1,9 @@
#include <stdio.h>
#include <board.h>
#include <kernel_intern.h>
extern void board_init();
extern void board_init(void);
__attribute__ ((constructor)) static void startup() {
__attribute__ ((constructor)) static void startup(void) {
/* use putchar so the linker links it in: */
putchar('\n');

View File

@ -1,5 +1,5 @@
#include <signal.h>
#include <board.h>
#include <msp430x16x.h>
#include <hwtimer.h>
#include <hwtimer_arch.h>
#include <cpu.h>
@ -9,7 +9,7 @@ static uint32_t ticks = 0;
extern void (*int_handler)(int);
extern void TA0_unset(short timer);
void timerA_init()
void timerA_init(void)
{
ticks = 0; // Set tick counter value to 0
TA0CTL = TASSEL_1 + TACLR; // Clear the timer counter, set ACLK

13
cpu/msp430x16x/makefile Normal file
View File

@ -0,0 +1,13 @@
MODULE =cpu
INCLUDES = -I../include -I$(RIOTBASE)/core/include
DIRS =
all: $(BINDIR)$(MODULE).a
@for i in $(DIRS) ; do $(MAKE) -C $$i ; done ;
include $(RIOTBASE)/makefile.base
clean::
@for i in $(DIRS) ; do $(MAKE) -C $$i clean ; done ;

View File

@ -1,10 +1,14 @@
DIRS = cpu core drivers sys
all:
mkdir -p $(BINDIR)
@for i in $(DIRS) ; do $(MAKE) -C $$i ; done ;
clean:
@for i in $(DIRS) ; do $(MAKE) -C $$i clean ; done ;
@if [ -d $(BINDIR) ] ; \
then rmdir $(BINDIR) ; \
fi
doc:
make -BC doc/doxygen

View File

@ -18,7 +18,7 @@ else
#USEMODULE += cpu_drivers cpu core lib sys
USEMODULE += cpu core sys
endif
ED = $(USEMODULE:%=-D MODULE_%)
ED = $(USEMODULE:%=-DMODULE_%)
EXTDEFINES = $(shell echo $(ED)|tr 'a-z' 'A-Z')
BL=$(USEMODULE:%= $(BINDIR)%.a)
# exclude hwtimer, because it is part of the kernel but the define is needed for auto_init