From 6b0d1f644233b2984d2a87553de598879cf05caf Mon Sep 17 00:00:00 2001
From: jinlicong <493886250@qq.com>
Date: Tue, 28 May 2024 17:24:59 +0800
Subject: [PATCH] 继续完善
---
Function/VALVE/valve_control.c | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/Function/VALVE/valve_control.c b/Function/VALVE/valve_control.c
index e76a010..3970320 100644
--- a/Function/VALVE/valve_control.c
+++ b/Function/VALVE/valve_control.c
@@ -2,6 +2,7 @@
#include "gpio.h"
#include "system_mem_para.h"
#include "power_manage.h"
+#include "linked_list.h"
__IO VALVE_CTRL_PARA_T valve_ctrl_para_g;
@@ -59,6 +60,16 @@
void ValveMotorCloseRun(void)
{
+
+ //�ж��Ƿ���Ҫ���ط�,����磬����������Ƴ�״̬�½��
+ if(__SYS_STATUS_BYTES_GET(alka_remove) == SET && __SYS_STATUS_BYTES_GET(alka_down) == SET){
+ if(__SYS_STATUS_BYTES_GET(power_state) == RESET){
+ borrow_Pwr_GPIO_Clk_Init();
+ BORROW_PWR_ON;
+ delay_ms(1);
+ }
+ }
+
Motor_AB_GPIO_Init();
Motor_OP_CL_GPIO_Init();
Motor_A_LOW;
@@ -75,6 +86,10 @@
GPIO_EXTI_Init( Motor_CL_PORT, Motor_CL_PIN, EXTI_FALLING, DISABLE);
Motor_A_LOW;
Motor_B_LOW;
+
+ //���ر�
+ borrow_Pwr_GPIO_Clk_Init();
+ BORROW_PWR_OFF;
}
@@ -236,7 +251,7 @@
if(system_status_word_g.status_word.valve_state != VALVE_ERROR){
//���������쳣����
if(__SYS_ALARM_REPORT_CTL_BYTES_GET(valve_error) == SET)
- __SYS_ALARM_BYTES_SET(valve_error, SET);
+ __SYS_ALARM_BYTES_SET(valve_error, ALARM_ID_VALVE_ABNORMAL);
system_alarm_word_for_valve_g.alarm_word.valve_error = SET; //�ط�����״̬��λ
}
--
Gitblit v1.9.3