- added STR710 example which I used for Eclipse debug testing
[fw/openocd] / testing / examples / STR710Test / src / main.c
1 /****************************************************************************\r
2 *  Copyright (c) 2006 by Michael Fischer. All rights reserved.\r
3 *\r
4 *  Redistribution and use in source and binary forms, with or without \r
5 *  modification, are permitted provided that the following conditions \r
6 *  are met:\r
7 *  \r
8 *  1. Redistributions of source code must retain the above copyright \r
9 *     notice, this list of conditions and the following disclaimer.\r
10 *  2. Redistributions in binary form must reproduce the above copyright\r
11 *     notice, this list of conditions and the following disclaimer in the \r
12 *     documentation and/or other materials provided with the distribution.\r
13 *  3. Neither the name of the author nor the names of its contributors may \r
14 *     be used to endorse or promote products derived from this software \r
15 *     without specific prior written permission.\r
16 *\r
17 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \r
18 *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT \r
19 *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS \r
20 *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL \r
21 *  THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, \r
22 *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, \r
23 *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS \r
24 *  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED \r
25 *  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, \r
26 *  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF \r
27 *  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF \r
28 *  SUCH DAMAGE.\r
29 *\r
30 ****************************************************************************\r
31 *  History:\r
32 *\r
33 *  30.03.06  mifi   First Version for Insight tutorial\r
34 *  26.01.08  mifi   Added variable "d" to test const variable.\r
35 ****************************************************************************/\r
36 #define __MAIN_C__\r
37 \r
38 /*\r
39  * I use the include only, to show\r
40  * how to setup a include dir in the makefile\r
41  */\r
42 #include "typedefs.h"\r
43 \r
44 /*=========================================================================*/\r
45 /*  DEFINE: All Structures and Common Constants                            */\r
46 /*=========================================================================*/\r
47 \r
48 /*=========================================================================*/\r
49 /*  DEFINE: Prototypes                                                     */\r
50 /*=========================================================================*/\r
51 \r
52 /*=========================================================================*/\r
53 /*  DEFINE: Definition of all local Data                                   */\r
54 /*=========================================================================*/\r
55 static const DWORD d = 7;\r
56 \r
57 /*=========================================================================*/\r
58 /*  DEFINE: Definition of all local Procedures                             */\r
59 /*=========================================================================*/\r
60 \r
61 /*=========================================================================*/\r
62 /*  DEFINE: All code exported                                              */\r
63 /*=========================================================================*/\r
64 /***************************************************************************/\r
65 /*  main                                                                   */\r
66 /***************************************************************************/\r
67 int main (void)\r
68 {\r
69   DWORD a = 1;\r
70   DWORD b = 2;\r
71   DWORD c = 0;\r
72     \r
73   a = a + d;\r
74     \r
75   while (1)\r
76   {\r
77     a++;\r
78     b++;\r
79     c = a + b;\r
80   }\r
81   \r
82   /*\r
83    * This return here make no sense.\r
84    * But to prevent the compiler warning:\r
85    * "return type of 'main' is not 'int'\r
86    * we use an int as return :-)\r
87    */ \r
88   return(0);\r
89 }\r
90 \r
91 /*** EOF ***/\r