Skip to content

Commit

Permalink
Merge pull request #408 from rousselk/simplify-msp430-headers
Browse files Browse the repository at this point in the history
Simplify msp430 headers
  • Loading branch information
OlegHahm committed Dec 19, 2013
2 parents ead2e11 + c1f8106 commit 37a7393
Show file tree
Hide file tree
Showing 18 changed files with 93 additions and 130 deletions.
3 changes: 3 additions & 0 deletions boards/Makefile.base
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ ifeq ($(BOARD),chronos)
INCLUDES += -I$(RIOTBOARD)/chronos/include/
INCLUDES += -I$(RIOTBOARD)/chronos/drivers/include/
endif
ifeq ($(BOARD),telosb)
INCLUDES += -I$(RIOTBOARD)/telosb/include/
endif
ifeq ($(BOARD),native)
INCLUDES += -I$(RIOTBOARD)/native/include/
endif
6 changes: 5 additions & 1 deletion boards/chronos/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
#define _MSB_BOARD_H

#include <stdint.h>
#include <cc430f6137.h>

// for correct inclusion of <msp430.h>
#ifndef __CC430F6137__
#define __CC430F6137__
#endif

#define MSP430_INITIAL_CPU_SPEED 7372800uL
#define MSP430_HAS_DCOR 1
Expand Down
9 changes: 7 additions & 2 deletions boards/msb-430/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ and the mailinglist (subscription via web site)
* <h2>Compontents</h2>
* \li MSP430
* \li CC1100
*
*
* @{
*
* @file board.h
Expand All @@ -46,6 +46,11 @@ and the mailinglist (subscription via web site)

#include "board-conf.h"

// for correct inclusion of <msp430.h>
#ifndef __MSP430F1612__
#define __MSP430F1612__
#endif

//MSB430 core
#define MSP430_INITIAL_CPU_SPEED 2457600uL
#define MSP430_HAS_DCOR 1
Expand All @@ -62,7 +67,7 @@ and the mailinglist (subscription via web site)
#define LED_RED_OFF LEDS_PxOUT |= LEDS_CONF_RED
#define LED_RED_TOGGLE LEDS_PxOUT ^= LEDS_CONF_RED

#include <msp430x16x.h>
#include "board-conf.h"

typedef uint8_t radio_packet_length_t;

Expand Down
6 changes: 5 additions & 1 deletion boards/msb-430h/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ and the mailinglist (subscription via web site)
#ifndef _MSB_BOARD_H
#define _MSB_BOARD_H

// for correct inclusion of <msp430.h>
#ifndef __MSP430F1612__
#define __MSP430F1612__
#endif

//MSB430 core
#define MSP430_INITIAL_CPU_SPEED 7372800uL
#define MSP430_HAS_DCOR 1
Expand All @@ -55,7 +60,6 @@ and the mailinglist (subscription via web site)
#define LED_RED_OFF LEDS_PxOUT |= LEDS_CONF_RED
#define LED_RED_TOGGLE LEDS_PxOUT ^= LEDS_CONF_RED

#include <msp430x16x.h>
#include "board-conf.h"

typedef uint8_t radio_packet_length_t;
Expand Down
6 changes: 5 additions & 1 deletion boards/telosb/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
#ifndef _TELOSB_BOARD_H
#define _TELOSB_BOARD_H

// for correct inclusion of <msp430.h>
#ifndef __MSP430F1611__
#define __MSP430F1611__
#endif

//MSB430 core
#define MSP430_INITIAL_CPU_SPEED 8000000uL
#define MSP430_HAS_DCOR 0
Expand All @@ -50,7 +55,6 @@
#define LED_BLUE_TOGGLE LEDS_PxOUT ^= LEDS_CONF_BLUE

#include <stdint.h>
#include <msp430x16x.h>

typedef uint8_t radio_packet_length_t;

Expand Down
5 changes: 5 additions & 0 deletions boards/wsn430-v1_3b/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@

#include "board-conf.h"

// for correct inclusion of <msp430.h>
#ifndef __MSP430F1611__
#define __MSP430F1611__
#endif

//MSB430 core
#define MSP430_INITIAL_CPU_SPEED 800000uL
#define MSP430_HAS_DCOR 0
Expand Down
5 changes: 5 additions & 0 deletions boards/wsn430-v1_4/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@

#include "board-conf.h"

// for correct inclusion of <msp430.h>
#ifndef __MSP430F1611__
#define __MSP430F1611__
#endif

//MSB430 core
#define MSP430_INITIAL_CPU_SPEED 800000uL
#define MSP430_HAS_DCOR 0
Expand Down
1 change: 0 additions & 1 deletion cpu/cc430/cc430-gpioint.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ See the file LICENSE in the top level directory for more details.
#include <cpu.h>
#include <irq.h>
#include <hwtimer.h>
#include <cc430f6137.h>

/** min and max portnumber to generate interrupts */
#define PORTINT_MIN (1)
Expand Down
1 change: 0 additions & 1 deletion cpu/cc430/cc430-rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ See the file LICENSE in the top level directory for more details.
#include <legacymsp430.h>
#include <irq.h>
#include <cpu.h>
#include <cc430f6137.h>
#include <cc430-rtc.h>

//static volatile time_t epoch;
Expand Down
41 changes: 41 additions & 0 deletions cpu/cc430/flashrom.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#include <stddef.h>
#include <stdint.h>
#include "cpu.h"
#include "irq.h"

static uint8_t prepare(void);
static void finish(uint8_t istate);
static inline void busy_wait(void);

/*---------------------------------------------------------------------------*/
uint8_t flashrom_erase(uint8_t *addr)
{
// TODO implement this function
return 0;
}
/*---------------------------------------------------------------------------*/
void flashrom_write(uint8_t *dst, uint8_t *src, size_t size)
{
// TODO implement this function
}

/*---------------------------------------------------------------------------*/
static uint8_t prepare(void)
{
// TODO implement this function

return 0;
}
/*---------------------------------------------------------------------------*/
void finish(uint8_t istate)
{
// TODO implement this function
}
/*---------------------------------------------------------------------------*/
static inline void busy_wait(void)
{
/* Wait for BUSY = 0, not needed unless run from RAM */
while (FCTL3 & 0x0001) {
nop();
}
}
6 changes: 1 addition & 5 deletions cpu/msp430-common/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ This file is part of RIOT.
This file is subject to the terms and conditions of the LGPLv2.
See the file LICENSE in the top level directory for more details.
*******************************************************************************/
#ifdef CC430
#include <cc430f6137.h>
#else
#include <msp430x16x.h>
#endif

#include "cpu.h"
#include "kernel.h"
#include "kernel_internal.h"
Expand Down
88 changes: 0 additions & 88 deletions cpu/msp430-common/flashrom.c

This file was deleted.

10 changes: 7 additions & 3 deletions cpu/msp430-common/include/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@ See the file LICENSE in the top level directory for more details.
* @{
*/

#include <sched.h>
#include <stdio.h>
#include <legacymsp430.h>
#include <msp430_types.h>
#include <cpu-conf.h>

#include "board.h"
#include <msp430.h>

#include "sched.h"
#include "msp430_types.h"
#include "cpu-conf.h"

#define WORDSIZE 16

Expand Down
10 changes: 2 additions & 8 deletions cpu/msp430-common/include/hwtimer_cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,10 @@ See the file LICENSE in the top level directory for more details.
#ifndef __HWTIMER_CPU_H
#define __HWTIMER_CPU_H

#include "cpu.h"

#ifdef CC430
#include <cc430f6137.h>
#else
#include <msp430x16x.h>
#endif
#include <cpu.h>
#include <stdint.h>

#include "cpu.h"

#ifdef __MSP430_HAS_TA2__
#define ARCH_MAXTIMERS 2
#endif
Expand Down
9 changes: 2 additions & 7 deletions cpu/msp430-common/irq.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#include <irq.h>
#ifdef CC430
#include <cc430f6137.h>
#else
#include <msp430x16x.h>
#endif
#include <cpu.h>
#include "irq.h"
#include "cpu.h"

unsigned int disableIRQ()
{
Expand Down
6 changes: 0 additions & 6 deletions cpu/msp430-common/msp430-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@
*/

#include "cpu.h"
#ifdef CC430
#include <cc430f6137.h>
#else
#include <msp430x16x.h>
#endif


/*---------------------------------------------------------------------------*/
static void
Expand Down
4 changes: 2 additions & 2 deletions cpu/msp430x16x/flashrom.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <stddef.h>
#include <stdint.h>
#include <msp430x16x.h>
#include <irq.h>
#include "cpu.h"
#include "irq.h"

uint8_t ie1, ie2;

Expand Down
7 changes: 3 additions & 4 deletions cpu/msp430x16x/hwtimer_msp430.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <msp430x16x.h>
#include <hwtimer.h>
#include <hwtimer_arch.h>
#include <cpu.h>
#include "cpu.h"
#include "hwtimer.h"
#include "hwtimer_arch.h"

static uint32_t ticks = 0;

Expand Down

0 comments on commit 37a7393

Please sign in to comment.