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