From: R. Steve McKown Date: Thu, 3 Nov 2011 23:45:36 +0000 (-0600) Subject: Updates for GCC 4.5.3 X-Git-Tag: patchset/2.1.1-4.5~1 X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=commitdiff_plain;h=bc58e5a5704f1eaa10cae4106cf5fd5529c20833 Updates for GCC 4.5.3 * Include correct GCC headers depending upon version * GCC does not stop the watchdog, so do it in PlatformP.nc * Stopping watchdog in MotePlatformC no longer needed (olimexp16, tmicore, tmirws) * tmicore writes TxIV in MoteClockP so needs MSP430REG_NORACE() --- diff --git a/tos/chips/msp430/msp430hardware.h b/tos/chips/msp430/msp430hardware.h index e5406c5b..b2a5cfc2 100644 --- a/tos/chips/msp430/msp430hardware.h +++ b/tos/chips/msp430/msp430hardware.h @@ -26,8 +26,15 @@ #ifndef _H_msp430hardware_h #define _H_msp430hardware_h +#if defined(__MSPGCC__) +/* mspgcc */ +#include +#include +#else /* __MSPGCC__ */ +/* old mspgcc3, forked mspgcc4 */ #include #include +#endif /* __MSPGCC__ */ #include "msp430regtypes.h" diff --git a/tos/platforms/epic/PlatformP.nc b/tos/platforms/epic/PlatformP.nc index acb3afbe..d44b5e7f 100644 --- a/tos/platforms/epic/PlatformP.nc +++ b/tos/platforms/epic/PlatformP.nc @@ -44,6 +44,9 @@ module PlatformP { } implementation { command error_t Init.init() { +#ifdef __MSP430_HAS_WDT__ + WDTCTL = WDTPW + WDTHOLD; +#endif call MoteClockInit.init(); call MoteInit.init(); call LedsInit.init(); diff --git a/tos/platforms/olimexp169/MotePlatformC.nc b/tos/platforms/olimexp169/MotePlatformC.nc index 816e544a..1f8df2f7 100644 --- a/tos/platforms/olimexp169/MotePlatformC.nc +++ b/tos/platforms/olimexp169/MotePlatformC.nc @@ -39,11 +39,6 @@ implementation { /* reset all of the ports to be input and using i/o functionality */ atomic { -#ifdef __MSP430_HAS_WDT__ - /* Stop the watchdog, if running. Should be somewhere in chips/msp430... */ - WDTCTL = WDTPW + WDTHOLD; -#endif - /* Port 1: 7-0:- */ P1SEL = 0; /* 0 0 0 0 0 0 0 0 */ P1OUT = 0; /* 0 0 0 0 0 0 0 0 */ diff --git a/tos/platforms/shimmer/PlatformP.nc b/tos/platforms/shimmer/PlatformP.nc index b8dc9438..01668fba 100644 --- a/tos/platforms/shimmer/PlatformP.nc +++ b/tos/platforms/shimmer/PlatformP.nc @@ -8,6 +8,9 @@ module PlatformP{ } implementation { command error_t Init.init() { +#ifdef __MSP430_HAS_WDT__ + WDTCTL = WDTPW + WDTHOLD; +#endif call MoteClockInit.init(); call MoteInit.init(); call LedsInit.init(); diff --git a/tos/platforms/shimmer/chips/msp430/msp430hardware.h b/tos/platforms/shimmer/chips/msp430/msp430hardware.h index 7911e9b3..dd0ab7f4 100644 --- a/tos/platforms/shimmer/chips/msp430/msp430hardware.h +++ b/tos/platforms/shimmer/chips/msp430/msp430hardware.h @@ -26,8 +26,15 @@ #ifndef _H_msp430hardware_h #define _H_msp430hardware_h +#if defined(__MSPGCC__) +/* mspgcc */ +#include +#include +#else /* __MSPGCC__ */ +/* old mspgcc3, forked mspgcc4 */ #include #include +#endif /* __MSPGCC__ */ #include "msp430regtypes.h" #include "Msp430DcoSpec.h" diff --git a/tos/platforms/shimmer2/PlatformP.nc b/tos/platforms/shimmer2/PlatformP.nc index b8dc9438..01668fba 100644 --- a/tos/platforms/shimmer2/PlatformP.nc +++ b/tos/platforms/shimmer2/PlatformP.nc @@ -8,6 +8,9 @@ module PlatformP{ } implementation { command error_t Init.init() { +#ifdef __MSP430_HAS_WDT__ + WDTCTL = WDTPW + WDTHOLD; +#endif call MoteClockInit.init(); call MoteInit.init(); call LedsInit.init(); diff --git a/tos/platforms/telosa/PlatformP.nc b/tos/platforms/telosa/PlatformP.nc index 34490d65..e56d8934 100644 --- a/tos/platforms/telosa/PlatformP.nc +++ b/tos/platforms/telosa/PlatformP.nc @@ -8,6 +8,9 @@ module PlatformP @safe() { } implementation { command error_t Init.init() { +#ifdef __MSP430_HAS_WDT__ + WDTCTL = WDTPW + WDTHOLD; +#endif call MoteClockInit.init(); call MoteInit.init(); call LedsInit.init(); diff --git a/tos/platforms/tinynode/PlatformP.nc b/tos/platforms/tinynode/PlatformP.nc index 81e9dbfb..f3d8ee98 100644 --- a/tos/platforms/tinynode/PlatformP.nc +++ b/tos/platforms/tinynode/PlatformP.nc @@ -7,6 +7,9 @@ module PlatformP{ } implementation { command error_t Init.init() { +#ifdef __MSP430_HAS_WDT__ + WDTCTL = WDTPW + WDTHOLD; +#endif call Msp430ClockInit.init(); TOSH_SET_PIN_DIRECTIONS(); call LedsInit.init(); diff --git a/tos/platforms/tmicore/MoteClockP.nc b/tos/platforms/tmicore/MoteClockP.nc index a9a97684..a3353972 100644 --- a/tos/platforms/tmicore/MoteClockP.nc +++ b/tos/platforms/tmicore/MoteClockP.nc @@ -39,6 +39,9 @@ module MoteClockP { } implementation { + MSP430REG_NORACE(TAIV); + MSP430REG_NORACE(TBIV); + command error_t Init.init() { volatile uint16_t i; diff --git a/tos/platforms/tmicore/MotePlatformC.nc b/tos/platforms/tmicore/MotePlatformC.nc index 6882e6e8..2199adfe 100644 --- a/tos/platforms/tmicore/MotePlatformC.nc +++ b/tos/platforms/tmicore/MotePlatformC.nc @@ -39,11 +39,6 @@ implementation { /* reset all of the ports to be input and using i/o functionality */ atomic { -#ifdef __MSP430_HAS_WDT__ - /* Stop the watchdog, if running. Should be somewhere in chips/msp430... */ - WDTCTL = WDTPW + WDTHOLD; -#endif - /* Port 1: 7:BQSTAT2, 6:BQSTAT1, 5:-, 4:-, 3:CP_CTS, 2:CP_RTS, * 1:BSL_TX, 0:- */ diff --git a/tos/platforms/tmirws/MotePlatformC.nc b/tos/platforms/tmirws/MotePlatformC.nc index ade28aa4..39b45c96 100644 --- a/tos/platforms/tmirws/MotePlatformC.nc +++ b/tos/platforms/tmirws/MotePlatformC.nc @@ -39,11 +39,6 @@ implementation { /* reset all of the ports to be input and using i/o functionality */ atomic { -#ifdef __MSP430_HAS_WDT__ - /* Stop the watchdog, if running. Should be somewhere in chips/msp430... */ - WDTCTL = WDTPW + WDTHOLD; -#endif - /* Port 1: 7:BQSTAT2, 6:BQSTAT1, 5:RAIN, 4:-, 3:CP_CTS, 2:CP_RTS, * 1:BSL_TX, 0:WSPEED */