/*
C File created automatically by AQ430 tools
*/
#include <MSP430Fx.h>
#include "watchdog.h"
//
// Add other include files here, as needed
//
//
// Hardware initializations
//

extern void watchdogDelay(int);

void AQ430_Init_HW(void)
{
_DINT();// Disable Interrupts
//
// [Ports]
//
P1DIR=0x00;
P1OUT=0x00;
P1SEL=0x00;
P1IES=0x00;
P1IE=0x00;

P2DIR=0x00;
P2OUT=0x00;
P2SEL=0x00;
P2IES=0x00;
P2IE=0x00;

P3DIR=0x07;
P3OUT=0x00;
P3SEL=0x30;

P4DIR=0xFF;
P4OUT=0x00;
P4SEL=0x00;

P5DIR=0x00;
P5OUT=0x00; // deassert SPI interrupt (active low)
P5SEL=0x00;

P6DIR=0x00;
P6OUT=0x00;
P6SEL=0xFF;

_EINT();// Enable Interrupts
}
//
//
// Main routine
//
void main(void)
{
  int i;
//
// Call hardware initialization function
//
AQ430_Init_HW();

P4OUT = 0xE1;

// delay for 3 secs to let relays stabilize
for(i=0;i<5000;i++)
  _NOP();
  
P4OUT = 0x01;
_NOP(); // debug breakpoint
_BIS_SR(LPM4_bits + GIE); // deep sleep (no clocks)
}
