From 9a03c11bfb74a18bc7a29f82dd058f6811025d60 Mon Sep 17 00:00:00 2001 From: "mr.zhangsan" Date: Tue, 18 Jun 2024 08:56:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96L3=5Fnew=5Frfid=E5=87=BD?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/app/app_config.c | 33 ++++++++++++++++++++++++++++++++- source/app/app_config.h | 2 ++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/source/app/app_config.c b/source/app/app_config.c index 68516f6..da680fa 100644 --- a/source/app/app_config.c +++ b/source/app/app_config.c @@ -152,7 +152,7 @@ void L3_reg_init(void) //L3_iap_2_reg(); } -U8 L3_new_rfid(U16 rfidno, U8 rssi, U8 ant) +U8 L3_new_rfid_1(U16 rfidno, U8 rssi, U8 ant) { U8 i = 0; for(i=0; i<4; i++) @@ -175,6 +175,37 @@ U8 L3_new_rfid(U16 rfidno, U8 rssi, U8 ant) return 0; } +U8 L3_new_rfid(U16 rfidno, U8 rssi, U8 ant) +{ + U8 i = 0; + for(i=0; i> 8 & 0xFF) && R.rfids[i].rfid_no[1] == (rfidno >> 0 & 0xFF)) + { + //该rfid已经存在 + break; + } + } + if(i == RFID_BUF_NUM) + { + i = 0; + } + + //放入RFID(空位置、已存在位置[替换为最新的rssi和ant]、0位置[放满了就从头开始放) + R.rfids[i].rfid_no[0] = rfidno >> 8 & 0xFF; + R.rfids[i].rfid_no[1] = rfidno >> 0 & 0xFF; + R.rfids[i].rssi = rssi; + R.rfids[i].ant = ant; + return 0; +} + + + U8 L3_find_rfid_table(U16 rfidno) { for(i=0; i