]> git.sur5r.net Git - freertos/blob - Demo/SuperH_SH7216_Renesas/RTOSDemo/resetprg.c
Start a new demo for a new SH2A port.
[freertos] / Demo / SuperH_SH7216_Renesas / RTOSDemo / resetprg.c
1 /***********************************************************************/\r
2 /*                                                                     */\r
3 /*  FILE        :resetprg.c                                            */\r
4 /*  DATE        :Sun, Dec 27, 2009                                     */\r
5 /*  DESCRIPTION :Reset Program                                         */\r
6 /*  CPU TYPE    :Other                                                 */\r
7 /*                                                                     */\r
8 /*  This file is generated by Renesas Project Generator (Ver.4.16).    */\r
9 /*                                                                     */\r
10 /***********************************************************************/\r
11                   \r
12 \r
13 \r
14 #include        <machine.h>\r
15 #include        <_h_c_lib.h>\r
16 //#include      <stddef.h>                                      // Remove the comment when you use errno\r
17 //#include      <stdlib.h>                                      // Remove the comment when you use rand()\r
18 #include        "typedefine.h"\r
19 #include        "stacksct.h"\r
20 \r
21 #define SR_Init    0x000000F0\r
22 #ifdef _FPD     // when -fpu=double is specified\r
23 #define FPSCR_Init 0x000C0001\r
24 #else\r
25 #define FPSCR_Init 0x00040001\r
26 #endif\r
27 #define INT_OFFSET 0x10\r
28 \r
29 extern _UINT INT_Vectors;\r
30 \r
31 #ifdef __cplusplus\r
32 extern "C" {\r
33 #endif\r
34 void PowerON_Reset_PC(void);\r
35 void Manual_Reset_PC(void);\r
36 void main(void);\r
37 #ifdef __cplusplus\r
38 }\r
39 #endif\r
40 \r
41 //#ifdef __cplusplus                            // Enable I/O in the application(both SIM I/O and hardware I/O)\r
42 //extern "C" {\r
43 //#endif\r
44 //extern void _INIT_IOLIB(void);\r
45 //extern void _CLOSEALL(void);\r
46 //#ifdef __cplusplus\r
47 //}\r
48 //#endif\r
49 \r
50 //extern void srand(_UINT);             // Remove the comment when you use rand()\r
51 //extern _SBYTE *_s1ptr;                                // Remove the comment when you use strtok()\r
52                 \r
53 //#ifdef __cplusplus                            // Use Hardware Setup\r
54 //extern "C" {\r
55 //#endif\r
56 //extern void HardwareSetup(void);\r
57 //#ifdef __cplusplus\r
58 //}\r
59 //#endif\r
60         \r
61 //#ifdef __cplusplus                    // Remove the comment when you use global class object\r
62 //extern "C" {                                  // Sections C$INIT and C$END will be generated\r
63 //#endif\r
64 //extern void _CALL_INIT(void);\r
65 //extern void _CALL_END(void);\r
66 //#ifdef __cplusplus\r
67 //}\r
68 //#endif\r
69 \r
70 #pragma section ResetPRG\r
71 \r
72 #pragma entry PowerON_Reset_PC\r
73 \r
74 void PowerON_Reset_PC(void)\r
75 {\r
76         set_vbr((void *)((_UBYTE *)&INT_Vectors - INT_OFFSET));\r
77 \r
78         set_fpscr(FPSCR_Init);\r
79 \r
80         _INITSCT();\r
81 \r
82 //      _CALL_INIT();                                   // Remove the comment when you use global class object\r
83 \r
84 //      _INIT_IOLIB();                                  // Enable I/O in the application(both SIM I/O and hardware I/O)\r
85 \r
86 //      errno=0;                                                // Remove the comment when you use errno\r
87 //      srand((_UINT)1);                                        // Remove the comment when you use rand()\r
88 //      _s1ptr=NULL;                                    // Remove the comment when you use strtok()\r
89 \r
90 //      HardwareSetup();                                // Use Hardware Setup\r
91 \r
92         set_cr(SR_Init);\r
93 \r
94         main();\r
95 \r
96 //      _CLOSEALL();                                    // Close I/O in the application(both SIM I/O andhardware I/O)\r
97 \r
98 //      _CALL_END();                                    // Remove the comment when you use global class object\r
99 \r
100         sleep();\r
101 }\r
102 \r
103 //#pragma entry Manual_Reset_PC         // Remove the comment when you use Manual Reset\r
104 void Manual_Reset_PC(void)      \r
105 {\r
106 }\r