From bf287c5b8a688eeee7dd8245d6bc28148799c601 Mon Sep 17 00:00:00 2001 From: czq <860517298@qq.com> Date: Wed, 14 May 2025 11:16:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9A=82=E5=AD=98=20?= =?UTF-8?q?=E6=B0=94=E5=8E=8B=E4=BC=A0=E6=84=9F=E5=99=A8=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- APP/peripheral_main.c | 4 +--- README.md | 8 +++----- bsp/src/bsp_bmp390.c | 20 ++++++++++---------- bsp/src/bsp_motor.c | 2 +- 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/APP/peripheral_main.c b/APP/peripheral_main.c index d7bf0a3..fea6482 100644 --- a/APP/peripheral_main.c +++ b/APP/peripheral_main.c @@ -103,9 +103,7 @@ int main(void) MultiTimerInstall((PlatformTicksFunction_t)BSP_Get_Tick); BSP_KEY_Init(app_task_handler); - BSP_MOTOR_Init(); - VALVE_OPEN(); - DelayMs(1000); + // BSP_MOTOR_Init(); BSP_VAVLE_Init(); BSP_LED_Init(); diff --git a/README.md b/README.md index 8575328..ae21f9e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -1.灯光需按说明显示 -2.低电压 -3.初始阀门状态确定 -4.按键偶现反转现象 -5.暂时屏蔽4G +1.电机停止需判断COIL_ADC优化 +2.低电压判断 +3.暂时屏蔽4G \ No newline at end of file diff --git a/bsp/src/bsp_bmp390.c b/bsp/src/bsp_bmp390.c index 1a4badb..24f5273 100644 --- a/bsp/src/bsp_bmp390.c +++ b/bsp/src/bsp_bmp390.c @@ -734,28 +734,28 @@ uint16_t Check_ProcessEvent(uint8_t task_id, uint16_t events) if(!fault_state) { //ѹ - if(P[0] - P[2] >= 80) //8000 + if(P[0] - P[2] >= 8000) { VALVE_CLOSE(); fault_state = 1; - tmos_start_task(check_task_id, MOTOR_STOP_EVT, MS1_TO_SYSTEM_TIME(1500)); //1000 - logDebug("motor high close"); + tmos_start_task(check_task_id, MOTOR_STOP_EVT, MS1_TO_SYSTEM_TIME(1000)); + logDebug("Over pressure state !"); } //Ƿѹ - if(P[0] - P[2] <= 80) //800 + if((P[0] - P[2] > 100) && (P[0] - P[2] <= 800)) { - // VALVE_CLOSE(); + VALVE_CLOSE(); fault_state = 2; - tmos_start_task(check_task_id, MOTOR_STOP_EVT, MS1_TO_SYSTEM_TIME(1500)); //1000 - logDebug("motor low close"); + tmos_start_task(check_task_id, MOTOR_STOP_EVT, MS1_TO_SYSTEM_TIME(1000)); + logDebug("Under voltage status !"); } // - if( P[0] - P[1] >= 7) //700 + if( P[0] - P[1] >= 700) { VALVE_CLOSE(); fault_state = 3; - tmos_start_task(check_task_id, MOTOR_STOP_EVT, MS1_TO_SYSTEM_TIME(1500)); //1000 - logDebug("motor ver close"); + tmos_start_task(check_task_id, MOTOR_STOP_EVT, MS1_TO_SYSTEM_TIME(1000)); + logDebug("Over current status !"); } } // logDebug("motor_flag_end = %d",motor_flag); diff --git a/bsp/src/bsp_motor.c b/bsp/src/bsp_motor.c index 1d4f64a..05605d9 100644 --- a/bsp/src/bsp_motor.c +++ b/bsp/src/bsp_motor.c @@ -19,7 +19,7 @@ void BSP_MOTOR_Init(void) GPIOB_ResetBits(COIL_B); GPIOB_ModeCfg(COIL_B, GPIO_ModeOut_PP_5mA); - //VALVE_CLOSE(); + VALVE_CLOSE(); } void VALVE_OPEN(void) {