From c8c350267fffa8a487b81d7aef2b4fe22b104094 Mon Sep 17 00:00:00 2001 From: "mr.zhangsan" Date: Wed, 29 May 2024 16:29:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8A=9F=E8=83=BD=E6=8C=89?= =?UTF-8?q?=E9=94=AE=E4=B8=8D=E9=80=80=E5=87=BA=E4=BD=8E=E5=8A=9F=E8=80=97?= =?UTF-8?q?=EF=BC=8C=E7=94=B1=E4=B8=8A=E4=BD=8D=E6=9C=BA=E8=B4=9F=E8=B4=A3?= =?UTF-8?q?=E9=80=80=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/app/app_config.c | 77 ++++++++++++++++++++----------------- source/app/app_config.h | 4 +- source/app/main.c | 4 ++ source/app/main.h | 1 + source/app/task_btn.c | 3 +- source/app/task_low_power.c | 46 ++++++++++++++++++++++ source/app/task_low_power.h | 32 +++++++++++++++ source/app/task_rs485.c | 34 +++++++++------- 8 files changed, 151 insertions(+), 50 deletions(-) create mode 100644 source/app/task_low_power.c create mode 100644 source/app/task_low_power.h diff --git a/source/app/app_config.c b/source/app/app_config.c index f236887..c5e2867 100644 --- a/source/app/app_config.c +++ b/source/app/app_config.c @@ -83,12 +83,8 @@ void L3_reg_reset(void) } //sop板默认不需要授权、未授权 - //授权标志由主控板通过协议传递 - // R.auth_flag = (0<<4) | 0; - R.auth_flag = (0<<4) | 0x01; - - //设置led灯状态 - L3_led_init(); + R.auth_flag = (0<<4) | 0; + // R.auth_flag = (0<<4) | 0x01; //从机ID R.slave_id = 0x01; @@ -99,18 +95,14 @@ void L3_reg_reset(void) //功能按键按下状态 R.func_btn = 0; + //设置led灯状态 + L3_led_clear(); + //nfc编号 - R.nfc.nfc_no[0] = 0; - R.nfc.nfc_no[1] = 0; + L3_nfc_clear(); //4路RFID编号 - for(i=0; i<4; i++) - { - R.rfids[i].rfid_no[0] = 0; - R.rfids[i].rfid_no[1] = 0; - R.rfids[i].rssi = 0; - R.rfids[i].ant = 0; - }; + L3_rfid_clear(); //for test // R.slave_id = 0x01; @@ -126,6 +118,33 @@ void L3_reg_reset(void) // }; } +void L3_led_clear(void) +{ + //设置led灯状态 + for(i=0; i> i) & 0x0001) + { + R.led_status[i] = LED0_ON; + } + } + } //构造响应包,并且返回 acklen = constructor_rs485_ack(); @@ -124,16 +140,8 @@ U8 constructor_rs485_ack() //清0资源 R.func_btn = 0; - R.nfc.nfc_no[0] = 0x00; - R.nfc.nfc_no[1] = 0x00; - R.rfids[0].rfid_no[0] = 0x00; - R.rfids[0].rfid_no[1] = 0x00; - R.rfids[1].rfid_no[0] = 0x00; - R.rfids[1].rfid_no[1] = 0x00; - R.rfids[2].rfid_no[0] = 0x00; - R.rfids[2].rfid_no[1] = 0x00; - R.rfids[3].rfid_no[0] = 0x00; - R.rfids[3].rfid_no[1] = 0x00; + L3_nfc_clear(); + L3_rfid_clear(); return 5 + num + 1; }