diff --git a/cpu/msp430/flash.c b/cpu/msp430/flash.c index f579ac0a1..df7d527da 100644 --- a/cpu/msp430/flash.c +++ b/cpu/msp430/flash.c @@ -29,7 +29,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * - * $Id: flash.c,v 1.1 2006/06/17 22:41:21 adamdunkels Exp $ + * $Id: flash.c,v 1.2 2007/11/17 10:28:04 adamdunkels Exp $ * * Author: Adam Dunkels * @@ -40,6 +40,7 @@ #include #include "dev/flash.h" +#include "dev/watchdog.h" #define FLASH_TIMEOUT 30 #define FLASH_REQ_TIMEOUT 150 @@ -57,7 +58,7 @@ flash_setup(void) IFG1 = 0; /* Stop watchdog. */ - WDTCTL = 0x5A80; + watchdog_stop(); /* DCO(SMCLK) is 2,4576MHz, /6 = 409600 Hz select SMCLK for flash timing, divider 5+1 */ @@ -80,7 +81,8 @@ flash_done(void) /* Enable interrupts. */ IE1 = ie1; IE2 = ie2; - _EINT(); + _EINT(); + watchdog_start(); } /*---------------------------------------------------------------------------*/ void diff --git a/cpu/msp430/msp430.c b/cpu/msp430/msp430.c index 2b2f63fe9..cea92fbc1 100644 --- a/cpu/msp430/msp430.c +++ b/cpu/msp430/msp430.c @@ -28,12 +28,12 @@ * * This file is part of the Contiki operating system. * - * @(#)$Id: msp430.c,v 1.6 2007/05/21 15:29:46 bg- Exp $ + * @(#)$Id: msp430.c,v 1.7 2007/11/17 10:28:18 adamdunkels Exp $ */ #include #include #include - +#include "dev/watchdog.h" #include "net/uip.h" /*---------------------------------------------------------------------------*/ @@ -53,7 +53,6 @@ msp430_init_dco(void) BCSCTL2 = 0x00; /* Init FLL to desired frequency using the 32762Hz crystal DCO frquenzy = 2,4576 MHz */ - WDTCTL = WDTPW + WDTHOLD; /* Stop WDT */ BCSCTL1 |= DIVA1 + DIVA0; /* ACLK = LFXT1CLK/8 */ for(i = 0xffff; i > 0; i--); /* Delay for XTAL to settle */ @@ -156,6 +155,7 @@ void msp430_cpu_init(void) { dint(); + watchdog_stop(); init_ports(); msp430_init_dco(); eint();