]> git.sur5r.net Git - freertos/blob - Demo/ColdFire_MCF52259_CodeWarrior/Freescale_Headers/common.h
Change to the file headers only.
[freertos] / Demo / ColdFire_MCF52259_CodeWarrior / Freescale_Headers / common.h
1 /*\r
2  * File:                common.h\r
3  * Purpose:             File to be included by all project files\r
4  *\r
5  * Notes:\r
6  * \r
7  * License:     All software covered by license agreement in -\r
8  *              docs/Freescale_Software_License.pdf\r
9  */\r
10 \r
11 #ifndef _COMMON_H_\r
12 #define _COMMON_H_\r
13 \r
14 /********************************************************************/\r
15 \r
16 /*\r
17  * Debug prints ON (#define) or OFF (#undef)\r
18  */\r
19 #undef DEBUG_PRINT \r
20 #undef DEBUG_PRINT_D0D1 \r
21 \r
22 /* \r
23  * Include the generic CPU header file \r
24  */\r
25 #include "mcf5xxx.h"\r
26 \r
27 /* \r
28  * Include the specific CPU header file \r
29  */\r
30 #include "mcf5225x.h"\r
31 \r
32 #include "mcf5225x_evb.h"\r
33 \r
34 /* \r
35  * MetroWerks looks for an underscore prepended to C function names \r
36  */\r
37 #define _UNDERSCORE_\r
38 \r
39 /* \r
40  * The source uses __interrupt__ to identify a function as\r
41  * an interrupt or exception handler.  Codewarrior uses \r
42  * __declspec(interrupt), so we are appeasing it like this.\r
43  */\r
44 #define __interrupt__   __declspec(interrupt)\r
45 \r
46 /* \r
47  * Force functions to return values in D0 \r
48  */\r
49 #pragma pointers_in_D0\r
50 \r
51 /* \r
52  * Provide a few assembly instructions for C level routines\r
53  */\r
54 #define halt()      asm( halt)\r
55 #define nop()       asm( nop)\r
56 #define tpf()       asm( tpf)\r
57 #define stop_2700() asm( stop #0x2700)\r
58 #define stop_2600() asm( stop #0x2600)\r
59 #define stop_2500() asm( stop #0x2500)\r
60 #define stop_2400() asm( stop #0x2400)\r
61 #define stop_2300() asm( stop #0x2300)\r
62 #define stop_2200() asm( stop #0x2200)\r
63 #define stop_2100() asm( stop #0x2100)\r
64 #define stop_2000() asm( stop #0x2000)\r
65 \r
66 /* \r
67  * Define custom sections for relocating code, data, and constants \r
68  */\r
69 #pragma define_section relocate_code ".relocate_code" far_absolute RX\r
70 #pragma define_section relocate_data ".relocate_data" far_absolute RW\r
71 #pragma define_section relocate_const ".relocate_const" far_absolute R\r
72 #define __relocate_code__   __declspec(relocate_code)\r
73 #define __relocate_data__   __declspec(relocate_data)\r
74 #define __relocate_const__  __declspec(relocate_const)\r
75  \r
76 /* \r
77  * Include common utilities\r
78  */\r
79 void assert_failed(char *, int);\r
80 \r
81 #ifdef DEBUG_PRINT\r
82 #define ASSERT(expr) \\r
83         if (!(expr)) \\r
84                 assert_failed(__FILE__, __LINE__)\r
85 #else\r
86 #define ASSERT(expr)\r
87 #endif\r
88  \r
89 //#include "assert.h"\r
90 //#include "io.h"\r
91 //#include "stdlib.h"\r
92 \r
93 \r
94 /********************************************************************/\r
95 \r
96 #endif /* _COMMON_H_ */\r