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; }