提交 | 用户 | age
|
483170
|
1 |
/** |
Q |
2 |
****************************************************************************** |
|
3 |
* @file : globaldef.c |
|
4 |
* @brief : globaldef program body |
|
5 |
****************************************************************************** |
|
6 |
*/ |
|
7 |
#include "Globaldef.h" |
|
8 |
#include "stdint.h" |
|
9 |
|
|
10 |
volatile int PendSvCount=0; |
|
11 |
|
|
12 |
stUartStat Uart1Stat={0}; |
|
13 |
stUartStat Uart2Stat={0}; |
|
14 |
|
|
15 |
//const unsigned int DefaultUart1Baud = 230400; |
|
16 |
|
|
17 |
|
|
18 |
volatile int SysConfigs; |
|
19 |
|
|
20 |
/* |
|
21 |
int GetBoardType(void ) |
|
22 |
{ |
|
23 |
int BoardType=0; |
|
24 |
|
|
25 |
if ((SysConfigs&0x0040) != 0 ) |
|
26 |
BoardType = 1; //master 16ch borad |
|
27 |
else BoardType = 0; //slave 8 ch borad |
|
28 |
|
|
29 |
BoardType = BOARD_TYPE; |
|
30 |
return BoardType; |
|
31 |
} |
|
32 |
*/ |
|
33 |
/* |
|
34 |
int sintab[256]={ |
|
35 |
0, 1, 3, 4, 6, 7, 9, 10, 12, 14, 15, 17, 18, 20, 21, 23, |
|
36 |
25, 26, 28, 29, 31, 32, 34, 36, 37, 39, 40, 42, 43, 45, 46, 48, |
|
37 |
49, 51, 53, 54, 56, 57, 59, 60, 62, 63, 65, 66, 68, 69, 71, 72, |
|
38 |
74, 75, 77, 78, 80, 81, 83, 84, 86, 87, 89, 90, 92, 93, 95, 96, |
|
39 |
97, 99, 100, 102, 103, 105, 106, 108, 109, 110, 112, 113, 115, 116, 117, 119, |
|
40 |
120, 122, 123, 124, 126, 127, 128, 130, 131, 132, 134, 135, 136, 138, 139, 140, |
|
41 |
142, 143, 144, 146, 147, 148, 149, 151, 152, 153, 155, 156, 157, 158, 159, 161, |
|
42 |
162, 163, 164, 166, 167, 168, 169, 170, 171, 173, 174, 175, 176, 177, 178, 179, |
|
43 |
181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, |
|
44 |
197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 211, |
|
45 |
212, 213, 214, 215, 216, 217, 217, 218, 219, 220, 221, 221, 222, 223, 224, 225, |
|
46 |
225, 226, 227, 227, 228, 229, 230, 230, 231, 232, 232, 233, 234, 234, 235, 235, |
|
47 |
236, 237, 237, 238, 238, 239, 239, 240, 241, 241, 242, 242, 243, 243, 244, 244, |
|
48 |
244, 245, 245, 246, 246, 247, 247, 247, 248, 248, 249, 249, 249, 250, 250, 250, |
|
49 |
251, 251, 251, 251, 252, 252, 252, 252, 253, 253, 253, 253, 254, 254, 254, 254, |
|
50 |
254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 |
|
51 |
}; |
|
52 |
*/ |
|
53 |
/* |
|
54 |
const int sintab[256]={ |
|
55 |
0, 1, 3, 4, 6, 7, 9, 10, 12, 14, 15, 17, 18, 20, 21, 23, |
|
56 |
25, 26, 28, 29, 31, 32, 34, 36, 37, 39, 40, 42, 43, 45, 46, 48, |
|
57 |
49, 51, 53, 54, 56, 57, 59, 60, 62, 63, 65, 66, 68, 69, 71, 72, |
|
58 |
74, 75, 77, 78, 80, 81, 83, 84, 86, 87, 89, 90, 92, 93, 95, 96, |
|
59 |
97, 99, 100, 102, 103, 105, 106, 108, 109, 110, 112, 113, 115, 116, 117, 119, |
|
60 |
120, 122, 123, 124, 126, 127, 128, 130, 131, 132, 134, 135, 136, 138, 139, 140, |
|
61 |
142, 143, 144, 146, 147, 148, 149, 151, 152, 153, 155, 156, 157, 158, 159, 161, |
|
62 |
162, 163, 164, 166, 167, 168, 169, 170, 171, 173, 174, 175, 176, 177, 178, 179, |
|
63 |
181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, |
|
64 |
197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 211, |
|
65 |
212, 213, 214, 215, 216, 217, 217, 218, 219, 220, 221, 221, 222, 223, 224, 225, |
|
66 |
225, 226, 227, 227, 228, 229, 230, 230, 231, 232, 232, 233, 234, 234, 235, 235, |
|
67 |
236, 237, 237, 238, 238, 239, 239, 240, 241, 241, 242, 242, 243, 243, 244, 244, |
|
68 |
244, 245, 245, 246, 246, 247, 247, 247, 248, 248, 249, 249, 249, 250, 250, 250, |
|
69 |
251, 251, 251, 251, 252, 252, 252, 252, 253, 253, 253, 253, 254, 254, 254, 254, |
|
70 |
254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 |
|
71 |
}; |
|
72 |
|
|
73 |
// volatile int nCount=0; |
|
74 |
const int freqtab[] = |
|
75 |
{ |
|
76 |
0, |
|
77 |
262,294,330,349,392,440,494, |
|
78 |
523,587,659,698,784,880,988, |
|
79 |
1046,1175,1318,1397,1568,1760,1976 |
|
80 |
}; |
|
81 |
const int musictab2[]= |
|
82 |
{ |
|
83 |
8,4,8,4,12,4,12,4,13,4,13,4,12,8, |
|
84 |
11,4,11,4,10,4,10,4,9,4,9,4,8,8, |
|
85 |
12,4,12,4,11,4,11,4,10,4,10,4,9,8, |
|
86 |
12,4,12,4,11,4,11,4,10,4,10,4,9,8, |
|
87 |
8,4,8,4,12,4,12,4,13,4,13,4,12,8, |
|
88 |
11,4,11,4,10,4,10,4,9,4,9,4,8,8, |
|
89 |
}; |
|
90 |
const int musictab1[]= |
|
91 |
{ |
|
92 |
7+3,2,7+3,2,7+3,4,7+3,2,7+3,2,7+3,4, |
|
93 |
7+3,2,7+5,2,7+1,3,7+2,1,7+3,8, |
|
94 |
7+4,2,7+4,2,7+4,2,7+4,2,7+4,2,7+3,2,7+3,2,7+3,2, |
|
95 |
7+5,2,7+5,2,7+4,2,7+2,2,7+1,4,7+7+1,4, |
|
96 |
5,2,7+3,2,7+2,2,7+1,2,5,6,5,1,5,1, |
|
97 |
5,2,7+3,2,7+2,2,7+1,2,6,6,6,2, |
|
98 |
6,2,7+4,2,7+3,2,7+2,2,7,6,5,2, |
|
99 |
7+5,2,7+5,2,7+4,2,7+2,2,7+3,4,7+1,2,5,2, |
|
100 |
5,2,7+3,2,7+2,2,7+1,2,5,6,5,2,5,2,7+3,2,7+2,2,7+1,2,6,6,6,2, |
|
101 |
5,2,7+4,2,7+3,2,7+2,2,7+5,2,7+5,2,7+5,2,7+5,2, |
|
102 |
7+6,2,7+5,2,7+4,2,7+2,2,7+1,6,0,2, |
|
103 |
|
|
104 |
}; |
|
105 |
const int Totalmusiccount=sizeof(musictab1)/sizeof(int)/2; |
|
106 |
int cur_musicpos = 0; |
|
107 |
const int outtype=2; |
|
108 |
*/ |