Browse Source

设置低功耗模式关闭rfid

bfysop-v2
mr.zhangsan 1 year ago
parent
commit
6c2039ff70
  1. 12
      source/app/app_config.c
  2. 3
      source/app/task_low_power.c

12
source/app/app_config.c

@ -1,6 +1,7 @@
#include "app_config.h" #include "app_config.h"
#include "../bsp/cs1232.h" #include "../bsp/cs1232.h"
#include "../bsp/chipid.h" #include "../bsp/chipid.h"
#include "../bsp/bsp_rfid.h"
#include "../msp/eeprom.h" #include "../msp/eeprom.h"
GlobalParam G; GlobalParam G;
@ -195,4 +196,15 @@ void L3_set_power_mode(U8 mode)
// } // }
// } // }
R.power_mode = mode; R.power_mode = mode;
if(R.power_mode == POWER_LOW)
{
//除了功能按键,所有灯全灭
L3_led_clear();
//禁用rfid
bsp_rfid_en(RFID_DISABLE);
}
else
{
bsp_rfid_en(RFID_ENABLE);
}
} }

3
source/app/task_low_power.c

@ -13,6 +13,7 @@
#include "task_low_power.h" #include "task_low_power.h"
#include "../app/app_config.h" #include "../app/app_config.h"
#include "../bsp/bsp_config.h" #include "../bsp/bsp_config.h"
#include "../bsp/bsp_rfid.h"
#include "../msp/uart0.h" #include "../msp/uart0.h"
S_TASK_LOW_POWER _s_task_low_power; S_TASK_LOW_POWER _s_task_low_power;
@ -35,6 +36,8 @@ void L3_task_low_power_handler(S_TASK_LOW_POWER *s)
{ {
//除了功能按键,所有灯全灭 //除了功能按键,所有灯全灭
L3_led_clear(); L3_led_clear();
//禁用RFID
bsp_rfid_en(RFID_DISABLE);
} }
L2_task_go_Tdelay(D_task_LOW_POWER_SET,D_Tdelay_1s); L2_task_go_Tdelay(D_task_LOW_POWER_SET,D_Tdelay_1s);

Loading…
Cancel
Save