Fixed the doc
[cerebrum.git] / msp / main.c
blobe017702047ae4fa7bbf0d3b8eceb27faad3b80e9
2 /*
3 Copyright (C) 2012 jaseg <s@jaseg.de>
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 version 3 as published by the Free Software Foundation.
8 */
10 #include <msp430.h>
11 #include "autocode.h"
12 #include "comm.h"
14 int main(void){
15 WDTCTL = WDTPW | WDTHOLD; //Disable WDT
16 P1DIR = 0x41; //P1.6 (green led) and P1.0 (red LED) outputs
18 //oscillator control
19 DCOCTL |= DCO1 | DCO0;
20 BCSCTL1 |= RSEL3 | RSEL2 | RSEL0;
22 //UART io setup (RX: P1.1, TX: P1.2)
23 P1SEL |= 0x03;
24 P1SEL2 |= 0x03;
26 init_auto();
28 //set global interrupt enable bit
29 _BIS_SR(GIE);
31 for(;;){
32 comm_loop();
33 loop_auto();
34 unsigned int i = 0xffff;
35 while(--i);