From 6c7e61a54ef9b96f79704f0b965664e89f57dd52 Mon Sep 17 00:00:00 2001
From: jinlicong <493886250@qq.com>
Date: Wed, 29 May 2024 17:41:52 +0800
Subject: [PATCH] 增加休眠,开始上板测试
---
Function/KEY/key.c | 47 +++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 43 insertions(+), 4 deletions(-)
diff --git a/Function/KEY/key.c b/Function/KEY/key.c
index 9aa3b1b..d5af81e 100644
--- a/Function/KEY/key.c
+++ b/Function/KEY/key.c
@@ -1,6 +1,8 @@
#include "key.h"
#include "gpio.h"
#include "lcd.h"
+#include "main.h"
+#include "system_run_fun.h"
/*******************************************************************************
* Function Name: Key_GPIO_Init
@@ -10,10 +12,10 @@
******************************************************************************/
void Key_GPIO_Init(void)
{
- InputtIO(KEY1_PORT,KEY1_PIN,IN_PULLUP);
- InputtIO(KEY2_PORT,KEY2_PIN,IN_PULLUP);
- InputtIO(KEY3_PORT,KEY3_PIN,IN_PULLUP);
- InputtIO(KEY4_PORT,KEY4_PIN,IN_PULLUP);
+ InputtIO(KEY1_PORT,KEY1_PIN,IN_NORMAL);
+ InputtIO(KEY2_PORT,KEY2_PIN,IN_NORMAL);
+ InputtIO(KEY3_PORT,KEY3_PIN,IN_NORMAL);
+// InputtIO(KEY4_PORT,KEY4_PIN,IN_PULLUP);
}
@@ -26,6 +28,12 @@
R_Key2Cnt = (KEY2_IO_READ==Bit_RESET)? R_Key2Cnt+1:0;
L_Key3Cnt = (KEY3_IO_READ==Bit_RESET)? L_Key3Cnt+1:0;
+
+ //���û�м����2��3����Ч
+ if(__SYS_DELAY_SEC_TIME_GET_(sys_active_time) ==0){
+ R_Key2Cnt = L_Key3Cnt = 0;
+ }
+
if(R_Key2Cnt== 5)
{
//�����Ҽ�����5������ѯģʽ
@@ -40,5 +48,36 @@
}
+
+ /**����ĿǰKey2��key3�õ�PE14��PE15����û���жϣ���ʱֻ����ѯ��ѯ*/
+ if(P_Key1Cnt ==0 && R_Key2Cnt >0 && L_Key3Cnt ==0) //����key2 �Ҽ�
+ {
+ lcd_wake_up_flag_g = 1;
+ if(__SYS_DELAY_SEC_TIME_GET_(sys_active_time) >0){ //��������ⰴ�����ü���ʱ��
+ __SYS_DELAY_SEC_TIME_SET_(sys_active_time,SYS_WAKE_UP_TIME);
+ }
+ }
+
+ if(P_Key1Cnt ==0 && R_Key2Cnt ==0 && L_Key3Cnt >0) //����key3 ���
+ {
+ lcd_wake_up_flag_g = 1;
+ if(__SYS_DELAY_SEC_TIME_GET_(sys_active_time) >0){ //��������ⰴ�����ü���ʱ��
+ __SYS_DELAY_SEC_TIME_SET_(sys_active_time,SYS_WAKE_UP_TIME);
+ }
+ }else if(P_Key1Cnt ==0 && R_Key2Cnt >0 && L_Key3Cnt >0) //����key2 + key3
+ {
+ lcd_wake_up_flag_g = 1;
+ if(__SYS_DELAY_SEC_TIME_GET_(sys_active_time) >0){ //��������ⰴ�����ü���ʱ��
+ __SYS_DELAY_SEC_TIME_SET_(sys_active_time,SYS_WAKE_UP_TIME);
+ }
+
+ //�ɼ����������ݲ������ϱ�
+ start_rs485_g = RS485_START_REASON_KEY;
+ start_wrc_g = WRC_MEANS_KEY;
+
+ }
+
+
+
}
--
Gitblit v1.9.3