Hi guys,

Ive got an error with this code. The error says ''Expected declaration''.
Code:
//
//
//
//
#include "msp430x20x1.h"

void main(void);

{
  WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT 
  P1DIR=0x7F;                               // P1.0 t/m P1.6 OUTPUT

  
  while(1);
  {
   if((P1IN&0x08)==0x08); 
       {
    P1OUT=0x7F;
  }
  
  else
  {
    P1OUT=0x01;
  }
  return 0;
  }
}
Thanks in advance!