diff --git a/source/app/main.c b/source/app/main.c index 9932d6c..1e55190 100644 --- a/source/app/main.c +++ b/source/app/main.c @@ -168,10 +168,10 @@ void main(void) } //设置bled任务 - L3_task_bled_handler(&_s_task_bled); + // L3_task_bled_handler(&_s_task_bled); - //扫描键盘任务 - L3_task_btn_handler(&_s_task_btn); + // //扫描键盘任务 + // L3_task_btn_handler(&_s_task_btn); //NFC协议处理 L3_task_nfc_handler(&_s_task_nfc); @@ -179,10 +179,10 @@ void main(void) //10s认证过期 L3_task_auth_handler(&_s_task_auth); - //RFID协议处理 + // //RFID协议处理 L3_task_rfid_handler(&_s_task_rfid); - //RS485协议处理 + // //RS485协议处理 L3_task_rs485_handler(&_s_task_rs485); //串口调试 diff --git a/source/app/task_nfc_auth.c b/source/app/task_nfc_auth.c index 19697a9..e5f2d1c 100644 --- a/source/app/task_nfc_auth.c +++ b/source/app/task_nfc_auth.c @@ -48,8 +48,9 @@ void L3_task_auth_handler(S_TASK_AUTH *s) TTSS_Task_step(D_task_AUTH_SETZERO) //清除授权标志 R.auth_flag &= 0xF0; - L0_uart0_sendstr("Auth Expired."); - L2_task_go_Tdelay(D_task_AUTH_READ,0); + // L0_uart0_sendstr("Auth Expired."); + // L2_task_go_Tdelay(D_task_AUTH_READ,0); + L2_task_go(D_task_AUTH_READ); TTSS_Task_end(); } diff --git a/source/app/task_rfid.c b/source/app/task_rfid.c index bd5240c..e560935 100644 --- a/source/app/task_rfid.c +++ b/source/app/task_rfid.c @@ -80,6 +80,11 @@ void L3_task_rfid_handler(S_TASK_RFID *s) U16 rfidno = (U16)tpc_rfid.buf[num-5] << 8 | tpc_rfid.buf[num-4]; U8 rssi = tpc_rfid.buf[0]; U8 ant = tpc_rfid.buf[num-1]; + + L0_uart0_uc('R'); + L0_uart0_uchex(tpc_rfid.buf[num-5]); + L0_uart0_uchex(tpc_rfid.buf[num-4]); + //1.判定RFID卡号是否符合规则 //2.保存RFID卡号到寄存器 L3_new_rfid(rfidno, rssi, ant); diff --git a/source/msp/UART0.C b/source/msp/UART0.C index 2c1f7ae..6184e95 100644 --- a/source/msp/UART0.C +++ b/source/msp/UART0.C @@ -60,7 +60,7 @@ msp/uartx.c 底层代码 和cpu相关 缓存发送也放在里面 int g_uart0_send_num = 0; //发送缓冲区 -static volatile Ts_uart_send_buf idata ts_uart_send_buf; +static volatile Ts_uart_send_buf ts_uart_send_buf; //接收缓冲区最多存放16个字符,这个值尽量小,但要大于实际处理协议的缓冲区大小 U8 uart0_recv_buf[16]; Ts_uart_recv_buf ts_uart0_recv_buf; diff --git a/source/msp/UART2.c b/source/msp/UART2.c index 8bbc8e9..ca7a8bc 100644 --- a/source/msp/UART2.c +++ b/source/msp/UART2.c @@ -58,7 +58,7 @@ msp/uartx.c 底层代码 和cpu相关 缓存发送也放在里面 #include "../tpc/debug.h" //发送缓冲区 -static volatile Ts_uart_send_buf idata ts_uart_send_buf; +static volatile Ts_uart_send_buf ts_uart_send_buf; //接收缓冲区最多存放16个字符,这个值尽量小,但要大于实际处理协议的缓冲区大小 #define RECV_BUF_SIZE 16 static U8 uart2_recv_buf[RECV_BUF_SIZE]; diff --git a/source/msp/UART3.c b/source/msp/UART3.c index 874af49..5e5c455 100644 --- a/source/msp/UART3.c +++ b/source/msp/UART3.c @@ -58,7 +58,7 @@ msp/uartx.c 底层代码 和cpu相关 缓存发送也放在里面 #include "../tpc/debug.h" //发送缓冲区 -static volatile Ts_uart_send_buf idata ts_uart_send_buf; +static volatile Ts_uart_send_buf ts_uart_send_buf; //接收缓冲区最多存放16个字符,这个值尽量小,但要大于实际处理协议的缓冲区大小 #define RECV_BUF_SIZE 32 static U8 uart3_recv_buf[RECV_BUF_SIZE]; diff --git a/source/msp/UART4.C b/source/msp/UART4.C index 7ef7b59..71e8589 100644 --- a/source/msp/UART4.C +++ b/source/msp/UART4.C @@ -58,7 +58,7 @@ msp/uartx.c 底层代码 和cpu相关 缓存发送也放在里面 #include "../tpc/debug.h" //发送缓冲区 -static volatile Ts_uart_send_buf idata ts_uart_send_buf; +static volatile Ts_uart_send_buf ts_uart_send_buf; //接收缓冲区最多存放16个字符,这个值尽量小,但要大于实际处理协议的缓冲区大小 #define RECV_BUF_SIZE 32 static U8 uart4_recv_buf[RECV_BUF_SIZE]; diff --git a/source/msp/uart_x.c b/source/msp/uart_x.c index 330a235..5412395 100644 --- a/source/msp/uart_x.c +++ b/source/msp/uart_x.c @@ -56,7 +56,7 @@ msp/uartx.c 底层代码 和cpu相关 缓存发送也放在里面 ********************************************************************************/ #include "uart_x.h" -TS_uart_reg idata ts_uart[SERIAL_MAX_NUM] = {0}; +TS_uart_reg ts_uart[SERIAL_MAX_NUM] = {0}; void L0_uartN_set(U8 uartx,U8 x) /*reentrant*/ { diff --git a/source/msp/uart_x.h b/source/msp/uart_x.h index 16abc3f..495527a 100644 --- a/source/msp/uart_x.h +++ b/source/msp/uart_x.h @@ -94,12 +94,12 @@ typedef struct _ts_uart_recv_buf_ typedef struct _TS_uart_reg { - Ts_uart_send_buf idata *p; + Ts_uart_send_buf *p; Ts_uart_recv_buf *t; void (*tp_handler)(Ts_uart_recv_buf *); }TS_uart_reg; -extern TS_uart_reg idata ts_uart[SERIAL_MAX_NUM]; +extern TS_uart_reg ts_uart[SERIAL_MAX_NUM]; extern void L0_uartN_init(U8 uartx); extern void L0_uartN_set(U8 uartx,U8 x); diff --git a/source/tpc/debug.c b/source/tpc/debug.c index fdd2ec2..4b4b54e 100644 --- a/source/tpc/debug.c +++ b/source/tpc/debug.c @@ -120,6 +120,8 @@ void L1_s2b_nfc (Ts_uart_recv_buf *p) //reentrant //帧尾:7E void L1_s2b_rfid (Ts_uart_recv_buf *p) //reentrant { + LED0 ^= 1; + if (0 == p->head) { if (p->head_0 == (p->reg & 0xFF))