-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path[最终版】长按时钟+1 时钟 倒计时时钟 暂停 跑马灯 两位跑马灯 数码管显示收到字符.txt
484 lines (404 loc) · 15.9 KB
/
[最终版】长按时钟+1 时钟 倒计时时钟 暂停 跑马灯 两位跑马灯 数码管显示收到字符.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
//考前必读!!!!!!
//将文件夹放到E盘根目录
//先检查已有代码能否正常运行
//串口助手选择115200 和 ASCII码
//串口助手无法智能检测应该打开哪个串口,逐个尝试
//打开串口后千万不要拔掉数据线,拔掉之前要先关闭串口
//长按reset或多次短按reset,会导致板子休克,要拔掉重插数据线,注意上条
//c里面不能表示二进制,直接写数字代表十进制,0x十六进制。可以提前打开进制转换工具
//沉着思考,冷静答题!!!!!
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include "hw_memmap.h"
#include "debug.h"
#include "gpio.h"
#include "hw_i2c.h"
#include "hw_types.h"
#include "i2c.h"
#include "pin_map.h"
#include "sysctl.h"
#include "systick.h"
#include "interrupt.h"
#include "uart.h"
#include "hw_ints.h"
#define SYSTICK_FREQUENCY 1000 //1000hz
#define I2C_FLASHTIME 500 //500mS
#define GPIO_FLASHTIME 300 //300mS
//*****************************************************************************
//
//I2C GPIO chip address and resigster define
//
//*****************************************************************************
#define TCA6424_I2CADDR 0x22
#define PCA9557_I2CADDR 0x18
#define PCA9557_INPUT 0x00
#define PCA9557_OUTPUT 0x01
#define PCA9557_POLINVERT 0x02
#define PCA9557_CONFIG 0x03
#define TCA6424_CONFIG_PORT0 0x0c
#define TCA6424_CONFIG_PORT1 0x0d
#define TCA6424_CONFIG_PORT2 0x0e
#define TCA6424_INPUT_PORT0 0x00
#define TCA6424_INPUT_PORT1 0x01
#define TCA6424_INPUT_PORT2 0x02
#define TCA6424_OUTPUT_PORT0 0x04
#define TCA6424_OUTPUT_PORT1 0x05
#define TCA6424_OUTPUT_PORT2 0x06
void Delay(uint32_t value);
void S800_GPIO_Init(void);
uint8_t I2C0_WriteByte(uint8_t DevAddr, uint8_t RegAddr, uint8_t WriteData);
uint8_t I2C0_ReadByte(uint8_t DevAddr, uint8_t RegAddr);
void S800_I2C0_Init(void);
void S800_UART_Init(void);
//systick software counter define
volatile uint16_t systick_10ms_couter = 10, systick_100ms_couter = 100;
volatile uint8_t systick_10ms_status = 0, systick_100ms_status = 0;
volatile uint8_t result, cnt, key_value, gpio_status;
volatile uint8_t rightshift = 0x01;
uint32_t ui32SysClock, ui32IntPriorityGroup, ui32IntPriorityMask;
uint32_t ui32IntPrioritySystick, ui32IntPriorityUart0;
uint8_t seg7[] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x58,0x5e,0x079,0x71,0x5c };
uint8_t disp_buff[8];
char const disp_tab[] = { '0','1','2','3','4','5', //the could display char and its segment code
'6','7','8','9','A','b',
'C','d','E','F',
'H','L','P','o',
'.','-','_',' ' };
char const disp_tab_7seg[] = { 0x3F,0x06,0x5B,0x4F,0x66,0x6D,
0x7D,0x07,0x7F,0x6F,0x77,0x7C,
0x39,0x5E,0x79,0x71,
0x76,0x38,0x73,0x5c,
0x80,0x40, 0x08,0x00 };
char ASCII2Disp(char *buff);
uint8_t uart_receive_char;
uint8_t uart_receive_string[100];
uint8_t uart_send_string[100];
static int i, j;
volatile static int sec = 0, min = 0, hour = 0;
volatile static bool sw1;
volatile static bool sw2;
volatile static bool temp1 = 1;
volatile static bool temp2 = 0;
volatile static bool run = 1;
volatile static bool shun = 1;
volatile static int counter = -1;
//the disp_tab and disp_tab_7seg must be the Corresponding relation
//the last character should be the space(not display) character
int main(void)
{
volatile uint16_t i2c_flash_cnt, i2c_flash_cnt2, gpio_flash_cnt;
//use internal 16M oscillator, PIOSC
//ui32SysClock = SysCtlClockFreqSet((SYSCTL_XTAL_16MHZ |SYSCTL_OSC_INT |SYSCTL_USE_OSC), 16000000);
//ui32SysClock = SysCtlClockFreqSet((SYSCTL_XTAL_16MHZ |SYSCTL_OSC_INT |SYSCTL_USE_OSC), 8000000);
//use external 25M oscillator, MOSC
//ui32SysClock = SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |SYSCTL_OSC_MAIN |SYSCTL_USE_OSC), 25000000);
//use external 25M oscillator and PLL to 120M
//ui32SysClock = SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |SYSCTL_OSC_MAIN | SYSCTL_USE_PLL |SYSCTL_CFG_VCO_480), 120000000);;
ui32SysClock = SysCtlClockFreqSet((SYSCTL_XTAL_16MHZ | SYSCTL_OSC_INT | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), 20000000);
SysTickPeriodSet(ui32SysClock / SYSTICK_FREQUENCY);
SysTickEnable();
SysTickIntEnable();
S800_GPIO_Init();
S800_I2C0_Init();
S800_UART_Init();
IntEnable(INT_UART0);
UARTIntEnable(UART0_BASE, UART_INT_RX | UART_INT_RT);
IntMasterEnable();
ui32IntPriorityMask = IntPriorityMaskGet();
IntPriorityGroupingSet(3); //Set all priority to pre-emtption priority
IntPrioritySet(INT_UART0, 3); //Set INT_UART0 to highest priority
IntPrioritySet(FAULT_SYSTICK, 0x0e0); //Set INT_SYSTICK to lowest priority
ui32IntPriorityGroup = IntPriorityGroupingGet();
ui32IntPriorityUart0 = IntPriorityGet(INT_UART0);
ui32IntPrioritySystick = IntPriorityGet(FAULT_SYSTICK);
while (1)
{
sw1 = GPIOPinRead(GPIO_PORTJ_BASE, GPIO_PIN_0); //ChangAn sw1,sw1==0 ELSE sw1==1
sw2 = GPIOPinRead(GPIO_PORTJ_BASE, GPIO_PIN_1); //ChangAn sw2,sw2==0 ELSE sw2==1
if (temp1 == 1) temp1 = GPIOPinRead(GPIO_PORTJ_BASE, GPIO_PIN_1);
if (temp1 == 0) temp2 = GPIOPinRead(GPIO_PORTJ_BASE, GPIO_PIN_1);
if (temp1 == 0 && temp2 == 1)
{
counter++; // press shortly once
counter = counter % 5;
temp1 = 1; temp2 = 0;
}
if (counter = -1) {};
if (counter == 0) {};
if (counter = 1) {};
if (counter == 2) {};
if (counter = 3) {};
if (counter == 4) {};
//sprintf(disp_buff, "%02d%1s%02d%1s%02d", hour, "-", min, "-", sec);
// d(10jinzhi) s(string) 2(2wei) 0(use 0 BuQi)
//sprintf(disp_buff, "%08s", "19981010"); // any given 8 wei string
if (systick_10ms_status)
{
systick_10ms_status = 0;
if (++gpio_flash_cnt >= 30) //10*30=300ms every 300ms run once
{
gpio_flash_cnt = 0;
if (gpio_status)
GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_0, GPIO_PIN_0);
else
GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_0, 0);
gpio_status = !gpio_status; //ShanShuo
}
}
if (systick_100ms_status&&run)// order run=0, when need pause
{
systick_100ms_status = 0;
if (++i2c_flash_cnt2 >= 2) //
{
i2c_flash_cnt2 = 0;
if(sw1==0) sec++; }
if (++i2c_flash_cnt >= 10) //run every 10*100=1000ms
{
i2c_flash_cnt = 0;
cnt++;
rightshift = rightshift << 1;
if (cnt == 8) { cnt = 0; rightshift = 0x01; }
if (shun) {
sec++;
if (sec >= 60) { sec = sec-60; min++; }
if (min>= 60) { min = min-60; hour++; }
if (hour >= 60) { hour = hour-60; }
}
else
{
sec--;
if (sec <=-1) { sec = sec+60; min--; }
if (min <= -1) { min = min+60; hour--; }
if (hour <= -1) { hour =hour+60; }
}
}
}//
sprintf(disp_buff, "%02d%1s%02d%1s%02d", hour, "-", min, "-", sec);
// d(10jinzhi number) s(string) 2 (2wei) 0(use 0 to buqi)
//sprintf(disp_buff, "%08s", "19981010"); // display any given 8 wei string
// sprintf(disp_buff, "%8s", uart_receive_string); //display string which banzi received
for (j = 0; j<8; j++) {
result = I2C0_WriteByte(TCA6424_I2CADDR, TCA6424_OUTPUT_PORT1, ASCII2Disp(disp_buff + j));
result = I2C0_WriteByte(TCA6424_I2CADDR, TCA6424_OUTPUT_PORT2, 0x1 << j);
result = I2C0_WriteByte(TCA6424_I2CADDR, TCA6424_OUTPUT_PORT2, 0x0);
}
/* //PaoMaDeng use this
result = I2C0_WriteByte(TCA6424_I2CADDR, TCA6424_OUTPUT_PORT1, ASCII2Disp(disp_buff + cnt));
result = I2C0_WriteByte(TCA6424_I2CADDR, TCA6424_OUTPUT_PORT2, rightshift);
result = I2C0_WriteByte(TCA6424_I2CADDR, TCA6424_OUTPUT_PORT2, 0x0);
result = I2C0_WriteByte(PCA9557_I2CADDR, PCA9557_OUTPUT, ~rightshift);//LED
*/
/* // 2 wei PaoMaDeng use this
if(cnt!=7) {
result = I2C0_WriteByte(TCA6424_I2CADDR, TCA6424_OUTPUT_PORT1, ASCII2Disp(disp_buff + cnt));
result = I2C0_WriteByte(TCA6424_I2CADDR, TCA6424_OUTPUT_PORT2, rightshift);
result = I2C0_WriteByte(TCA6424_I2CADDR, TCA6424_OUTPUT_PORT2, 0x0);
result = I2C0_WriteByte(TCA6424_I2CADDR, TCA6424_OUTPUT_PORT1, ASCII2Disp(disp_buff + cnt+1));
result = I2C0_WriteByte(TCA6424_I2CADDR, TCA6424_OUTPUT_PORT2, rightshift<<1);
result = I2C0_WriteByte(TCA6424_I2CADDR, TCA6424_OUTPUT_PORT2, 0x0);
result = I2C0_WriteByte(PCA9557_I2CADDR, PCA9557_OUTPUT, ~(rightshift|rightshift<<1));//LED
}
else {
result = I2C0_WriteByte(TCA6424_I2CADDR, TCA6424_OUTPUT_PORT1, ASCII2Disp(disp_buff + 7));
result = I2C0_WriteByte(TCA6424_I2CADDR, TCA6424_OUTPUT_PORT2, rightshift);
result = I2C0_WriteByte(TCA6424_I2CADDR, TCA6424_OUTPUT_PORT2, 0x0);
result = I2C0_WriteByte(TCA6424_I2CADDR, TCA6424_OUTPUT_PORT1, ASCII2Disp(disp_buff ));
result = I2C0_WriteByte(TCA6424_I2CADDR, TCA6424_OUTPUT_PORT2, 0x01);
result = I2C0_WriteByte(TCA6424_I2CADDR, TCA6424_OUTPUT_PORT2, 0x0);
result = I2C0_WriteByte(PCA9557_I2CADDR, PCA9557_OUTPUT, ~0x81);//LED
}
*/
}
}
char ASCII2Disp(char *buff)
{
char * pcDisp;
pcDisp = (char*)strchr(disp_tab, *buff);
if (pcDisp == NULL)
return 0x0;
else
return (disp_tab_7seg[pcDisp - disp_tab]);
}
void Delay(uint32_t value)
{
uint32_t ui32Loop;
for (ui32Loop = 0; ui32Loop < value; ui32Loop++) {};
}
void UARTStringPut(const char *cMessage)
{
while (*cMessage != '\0')
UARTCharPut(UART0_BASE, *(cMessage++));
}
void UARTStringPutNonBlocking(const char *cMessage)
{
while (*cMessage != '\0')
UARTCharPutNonBlocking(UART0_BASE, *(cMessage++));
}
void S800_UART_Init(void)
{
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); //Enable PortA
while (!SysCtlPeripheralReady(SYSCTL_PERIPH_GPIOA)); //Wait for the GPIO moduleA ready
GPIOPinConfigure(GPIO_PA0_U0RX); // Set GPIO A0 and A1 as UART pins.
GPIOPinConfigure(GPIO_PA1_U0TX);
GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
// Configure the UART for 115,200, 8-N-1 operation.
UARTConfigSetExpClk(UART0_BASE, ui32SysClock, 115200, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));
UARTStringPut((uint8_t *)"\r\nHello, world!\r\n");
}
void S800_GPIO_Init(void)
{
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); //Enable PortF
while (!SysCtlPeripheralReady(SYSCTL_PERIPH_GPIOF)); //Wait for the GPIO moduleF ready
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOJ); //Enable PortJ
while (!SysCtlPeripheralReady(SYSCTL_PERIPH_GPIOJ)); //Wait for the GPIO moduleJ ready
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPION); //Enable PortN
while (!SysCtlPeripheralReady(SYSCTL_PERIPH_GPION)); //Wait for the GPIO moduleN ready
GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_0 | GPIO_PIN_1);
GPIOPinTypeGPIOInput(GPIO_PORTJ_BASE, GPIO_PIN_0 | GPIO_PIN_1);
GPIOPinTypeGPIOOutput(GPIO_PORTN_BASE, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_4);
GPIOPinTypeGPIOInput(GPIO_PORTJ_BASE, GPIO_PIN_0 | GPIO_PIN_1);//Set the PJ0,PJ1 as input pin
GPIOPadConfigSet(GPIO_PORTJ_BASE, GPIO_PIN_0 | GPIO_PIN_1, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);
}
void S800_I2C0_Init(void)
{
uint8_t result;
SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C0);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
GPIOPinConfigure(GPIO_PB2_I2C0SCL);
GPIOPinConfigure(GPIO_PB3_I2C0SDA);
GPIOPinTypeI2CSCL(GPIO_PORTB_BASE, GPIO_PIN_2);
GPIOPinTypeI2C(GPIO_PORTB_BASE, GPIO_PIN_3);
I2CMasterInitExpClk(I2C0_BASE, ui32SysClock, true); //config I2C0 400k
I2CMasterEnable(I2C0_BASE);
result = I2C0_WriteByte(TCA6424_I2CADDR, TCA6424_CONFIG_PORT0, 0x0ff); //config port 0 as input
result = I2C0_WriteByte(TCA6424_I2CADDR, TCA6424_CONFIG_PORT1, 0x0); //config port 1 as output
result = I2C0_WriteByte(TCA6424_I2CADDR, TCA6424_CONFIG_PORT2, 0x0); //config port 2 as output
result = I2C0_WriteByte(PCA9557_I2CADDR, PCA9557_CONFIG, 0x00); //config port as output
result = I2C0_WriteByte(PCA9557_I2CADDR, PCA9557_OUTPUT, 0x0ff); //turn off the LED1-8
}
uint8_t I2C0_WriteByte(uint8_t DevAddr, uint8_t RegAddr, uint8_t WriteData)
{
uint8_t rop;
while (I2CMasterBusy(I2C0_BASE)) {};
I2CMasterSlaveAddrSet(I2C0_BASE, DevAddr, false);
I2CMasterDataPut(I2C0_BASE, RegAddr);
I2CMasterControl(I2C0_BASE, I2C_MASTER_CMD_BURST_SEND_START);
while (I2CMasterBusy(I2C0_BASE)) {};
rop = (uint8_t)I2CMasterErr(I2C0_BASE);
I2CMasterDataPut(I2C0_BASE, WriteData);
I2CMasterControl(I2C0_BASE, I2C_MASTER_CMD_BURST_SEND_FINISH);
while (I2CMasterBusy(I2C0_BASE)) {};
rop = (uint8_t)I2CMasterErr(I2C0_BASE);
return rop;
}
uint8_t I2C0_ReadByte(uint8_t DevAddr, uint8_t RegAddr)
{
uint8_t value, rop;
while (I2CMasterBusy(I2C0_BASE)) {};
I2CMasterSlaveAddrSet(I2C0_BASE, DevAddr, false);
I2CMasterDataPut(I2C0_BASE, RegAddr);
// I2CMasterControl(I2C0_BASE, I2C_MASTER_CMD_BURST_SEND_START);
I2CMasterControl(I2C0_BASE, I2C_MASTER_CMD_SINGLE_SEND);
while (I2CMasterBusBusy(I2C0_BASE));
rop = (uint8_t)I2CMasterErr(I2C0_BASE);
Delay(1);
//receive data
I2CMasterSlaveAddrSet(I2C0_BASE, DevAddr, true);
I2CMasterControl(I2C0_BASE, I2C_MASTER_CMD_SINGLE_RECEIVE);
while (I2CMasterBusBusy(I2C0_BASE));
value = I2CMasterDataGet(I2C0_BASE);
Delay(1);
return value;
}
/*
Corresponding to the startup_TM4C129.s vector table systick interrupt program name
*/
void SysTick_Handler(void)
{
if (systick_100ms_couter != 0)
systick_100ms_couter--;
else
{
systick_100ms_couter = 100;
systick_100ms_status = 1;
}
if (systick_10ms_couter != 0)
systick_10ms_couter--;
else
{
systick_10ms_couter = 10;
systick_10ms_status = 1;
}
/*
if (sw2 == 0) //if PJ1(SW2) ,pause tick
{
systick_100ms_status = systick_10ms_status = 0;
//GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_0, GPIO_PIN_0);
}
//else
//GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_0, 0);
*/
}
/*
Corresponding to the startup_TM4C129.s vector table UART0_Handler interrupt program name
*/
void UART0_Handler(void)
{
int32_t uart0_int_status;
uart0_int_status = UARTIntStatus(UART0_BASE, true); // Get the interrrupt status.
UARTIntClear(UART0_BASE, uart0_int_status); //Clear the asserted interrupts
//for (j = 0; j<100; j++) uart_receive_string[j] = 0; //useless;and may cause unexplained trouble
i = 0;
while (UARTCharsAvail(UART0_BASE)) // Loop while there are characters in the receive FIFO.
{
// UARTCharPutNonBlocking(UART0_BASE,UARTCharGetNonBlocking(UART0_BASE));
uart_receive_string[i] = UARTCharGetNonBlocking(UART0_BASE);
Delay(150); //don't delete. too much or too little both cause trouble
i++;
// GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_1, GPIO_PIN_1);
}
uart_receive_string[i] = '\0';
//GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_1, 0);
if (!strncasecmp(uart_receive_string, "SET", 3)) {//strncasecmp (ignore daxiao xie)
// can select how many wei to compare
hour = 10 * (uart_receive_string[3] - '0') + (uart_receive_string[4] - '0');
min = 10 * (uart_receive_string[6] - '0') + (uart_receive_string[7] - '0');
sec = 10 * (uart_receive_string[9] - '0') + (uart_receive_string[10] - '0');
sprintf(uart_send_string, "%s%02d%s%02d%s%02d", "TIME", hour, "-", min, "-", sec);
UARTStringPutNonBlocking(uart_send_string);
}
else if (!strncasecmp(uart_receive_string, "INC", 3)) {
hour = hour + 10 * (uart_receive_string[3] - '0') + (uart_receive_string[4] - '0');
min = min + 10 * (uart_receive_string[6] - '0') + (uart_receive_string[7] - '0');
sec = sec + 10 * (uart_receive_string[9] - '0') + (uart_receive_string[10] - '0');
min = min + sec / 60; sec = sec % 60;
hour = hour + min / 60; min = min % 60;
hour = hour % 60;
sprintf(uart_send_string, "%s%02d%s%02d%s%02d", "TIME", hour, "-", min, "-", sec);
UARTStringPutNonBlocking(uart_send_string);
}
else if (!strcasecmp(uart_receive_string, "GETTIME"))
{
sprintf(uart_send_string, "%s%02d%s%02d%s%02d", "TIME", hour, "-", min, "-", sec);
UARTStringPutNonBlocking(uart_send_string);
}
else if (!strcasecmp(uart_receive_string, "abcdefg")) //strcasecmp (ignore daxiao xie)
UARTStringPutNonBlocking("1234567"); //strcmp if equal ,then return 0
else if (!strcasecmp(uart_receive_string, "123456"))
UARTStringPutNonBlocking("abcdefg");
else if (!strcasecmp(uart_receive_string, ""))
{
}
else if (!strcasecmp(uart_receive_string, ""))
{
}
else if (!strcasecmp(uart_receive_string, ""))
{
}
else if (!strcasecmp(uart_receive_string, ""))
{
}
else UARTStringPutNonBlocking(uart_receive_string);
}