You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.2 KiB
50 lines
1.2 KiB
#include "app_task_rfid.h"
|
|
#include "../msp/uart0.h"
|
|
#include "../msp/uart3.h"
|
|
|
|
#define MODBUS_SLAVER_RETRY_MAX_TIME 3
|
|
|
|
TS_rfid ts_rfid;
|
|
|
|
void L3_task_rfid_init(void)
|
|
{
|
|
L1_task_init(&ts_rfid.task);
|
|
L3_task_s_go(ts_rfid,D_task_init);
|
|
}
|
|
|
|
U8 rfid_start_pkg[] = {0xBB,0x00,0x27,0x00,0x03,0x22,0xFF,0xFF,0x4A,0x7E};
|
|
U8 rfid_stop_pkg[] = {0xBB,0x00,0x28,0x00,0x00,0x28,0x7E};
|
|
//U8 newrfid_start_pkg[] = {0xA0,0x0D,0x01,0x8A,0x00,0x32,0x01,0x32,0x02,0x32,0x03,0x32,0x00,0xFA,0x00};
|
|
//U8 newrfid_stop_pkg[] = {0xA0,0x04,0x01,0x74,0x00,0xE7};
|
|
|
|
|
|
void L1_enable_rfid()
|
|
{
|
|
//L0_uart0_sendArray(rfid_start_pkg,10);
|
|
//L0_uart3_sendArray(rfid_start_pkg,10);
|
|
//L0_uart0_sendArray(newrfid_start_pkg,15);
|
|
L0_uart3_sendArray(rfid_start_pkg,15);
|
|
}
|
|
|
|
void L1_disable_rfid()
|
|
{
|
|
//L0_uart0_sendArray(rfid_stop_pkg,7);
|
|
//L0_uart3_sendArray(rfid_stop_pkg,7);
|
|
//L0_uart0_sendArray(newrfid_stop_pkg,6);
|
|
L0_uart3_sendArray(rfid_stop_pkg,6);
|
|
}
|
|
|
|
#define D_task_rfid_send 0x51
|
|
void L3_task_rfid_handle(TS_rfid *s)
|
|
{
|
|
TTSS_Task_init();
|
|
L2_task_go(D_task_rfid_send);
|
|
|
|
TTSS_Task_step(D_task_rfid_send)
|
|
L1_enable_rfid();
|
|
L2_task_go_Tdelay(D_task_rfid_send, D_Tdelay_10s);
|
|
|
|
TTSS_Task_end();
|
|
}
|
|
|
|
|
|
|