1f552882851c43d35434ba760967cfdf067595e6
[goodfet] / firmware / tests / echo / echo.c
1 //GOODFET Echo test.\r
2 \r
3 \r
4 #include "platform.h"\r
5 \r
6 #include <signal.h>\r
7 #include <io.h>\r
8 #include <iomacros.h>\r
9 \r
10 \r
11 //LED on P1.0\r
12 //IO on P5\r
13 \r
14 //! Initialize registers and all that jazz.\r
15 void init(){\r
16   volatile unsigned int i;\r
17   WDTCTL = WDTPW + WDTHOLD;                 // Stop watchdog timer\r
18   \r
19   //LED and TX OUT\r
20   PLEDDIR |= PLEDPIN;\r
21   \r
22   msp430_init_dco();\r
23   \r
24   msp430_init_uart();\r
25   \r
26   while(1){\r
27     i = 10000;\r
28     while(i--);\r
29     \r
30     serial_tx(0x80);\r
31     PLEDOUT^=PLEDPIN;  // Blink\r
32   }\r
33   \r
34   //Enable Interrupts.\r
35   //eint();\r
36 }\r
37 \r
38 //! Main loop.\r
39 int main(void)\r
40 {\r
41   volatile unsigned int i;\r
42   init();\r
43   \r
44   \r
45   PLEDOUT^=PLEDPIN;  // Blink\r
46   \r
47   //while(1) serial_tx(serial_rx());\r
48   while(1) serial_tx(0x80);\r
49   \r
50   while(1){\r
51     i = 10000;\r
52     while(i--);\r
53     \r
54     PLEDOUT^=PLEDPIN;  // Blink\r
55   }\r
56 }\r
57 \r