From 437b8e9416a8bb9ced3e3dc63c4e4bc31670dfd5 Mon Sep 17 00:00:00 2001 From: sunbeam Date: Wed, 21 Aug 2024 22:00:16 +0800 Subject: [PATCH] =?UTF-8?q?20240821=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ECU_APP/user/PINdef.h | 4 ++-- ECU_APP/user/appTask.c | 14 +++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ECU_APP/user/PINdef.h b/ECU_APP/user/PINdef.h index 9f8a5b9..a5cb3b9 100644 --- a/ECU_APP/user/PINdef.h +++ b/ECU_APP/user/PINdef.h @@ -31,9 +31,9 @@ typedef enum typedef enum { ADCH_IGN, - ADCH_HALL_R, - ADCH_HALL_N, ADCH_HALL_F, + ADCH_HALL_N, + ADCH_HALL_R, ADCH_NUM, }ADCH_type; diff --git a/ECU_APP/user/appTask.c b/ECU_APP/user/appTask.c index 6831592..55534a8 100644 --- a/ECU_APP/user/appTask.c +++ b/ECU_APP/user/appTask.c @@ -372,11 +372,7 @@ void KeyPro(void) { lkey_state = 1; } - if (getKeyPressFlag(SIGID_SW_P_IN) == KEY_PRESSED) - { - Pkey_state = !Pkey_state; - //RE1LED_CTRL(Pkey_state); - } + if (getKeyPressFlag(SIGID_SW_RE2) == KEY_PRESSED) { re2key_state = !re2key_state; @@ -393,6 +389,14 @@ void KeyPro(void) lkey_state = 0; } + if(lock_state == LOCK_STATE_UNLOCKED) + { + Pkey_state = GetKeyState(SIGID_SW_P_IN); + } + else + { + Pkey_state = KEY_NOPRESSED; + } }