Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagecpp
themeConfluence
linenumberstrue
#include <msp430.h>

int main(void) {
  WDTCTL = WDTPW | WDTHOLD;    // Stop watchdog timer

  P1OUT &= ~BIT0;
  P1DIR |= BIT0;


  TA0CTL |= TASSEL_2 | MC_2 | ID_3;
  TA0CCTL0 |= CCIE;
  TA0CCR0 = 65535;
  __enable_interrupt();

  for (;;) { }

  return 0;
}

#pragma vector = TIMER0_A0_VECTOR
__interrupt void TIMER0_A0_ISR(void) {
  P1OUT ^= BIT0;
}

...