From 65062d0d5b21f838aa0043a15ce54cfab8d72c43 Mon Sep 17 00:00:00 2001
From: wujiazhi <1147861305@qq.com>
Date: Tue, 11 Jun 2024 14:23:53 +0800
Subject: [PATCH] 1.Fixed communication failure between MCU and wireless module 2.Fix the wrong judgment of alkaline lithium power
---
HARDWARE/TIM/tim.c | 51 +++++++++++++++++++++++++++++++++------------------
1 files changed, 33 insertions(+), 18 deletions(-)
diff --git a/HARDWARE/TIM/tim.c b/HARDWARE/TIM/tim.c
index 05fe5c3..fdd86fd 100644
--- a/HARDWARE/TIM/tim.c
+++ b/HARDWARE/TIM/tim.c
@@ -1,9 +1,29 @@
#include "tim.h"
-#include "rs485_read_data.h"
+#include "master_slave_inter.h"
+#include "power_manage.h"
+#include "valve_control.h"
+#include "multi_button.h"
#include "gpio.h"
-#include "pulse_and_alarm_line.h"
uint8_t first_power_tim_cnt_g = 5;
+
+//void BSTIM_IRQHandler(void)
+//{
+//
+// if(BSTIM_ISR_UIF_Chk()!=RESET) //��/�ط�ʱ��
+// {
+// BSTIM_ISR_UIF_Clr();
+// if (__SYS_STATUS_BYTES_GET(valve_state) == VALVE_CLOSING || __SYS_STATUS_BYTES_GET(valve_state) == VALVE_OPENING)
+// {
+// valve_signal_complete_g = SET; //��λ�ź�
+// VALVE_SLEEP;
+// VALVE_PWR_OFF; // �رյ�Դ
+// if(sys_bst_flag == 0)
+// SYS_BST_DIS;
+// }
+// }
+//
+//}
void BTx_IRQHandler(void)
@@ -12,35 +32,29 @@
{
BTx_ISR_CMPLIF_Clr(BT1);
BTx_ISR_CMPHIF_Clr(BT1);
-
- BTx_CR1_CHEN_Setable(BT1,DISABLE);
- pulse_exti_flag = RESET;
-
- pulse_count +=1;
-
+ sys_time_g.sys_cal_run_period = SET;//����ʱ��
}else if(BTx_ISR_CMPHIF_Chk(BT2)==SET)
{
BTx_ISR_CMPLIF_Clr(BT2);
BTx_ISR_CMPHIF_Clr(BT2);
-
+ ++first_power_tim_cnt_g;
+ if(first_power_tim_cnt_g % 5 == 0)
+ {
+ pwr_vol_g.lith_flag = LMS_PERIOD;//�״��ϵ磬��ѹ��μ���
+ if(++first_power_get_cnt_g >= FIRST_POWER_TIM_MAX)
+ BTx_CR1_CHEN_Setable(BT2,DISABLE);
+ }
+
}
}
-void BSTIM_IRQHandler(void)
-{
- if(BSTIM_ISR_UIF_Chk()!=RESET)
- {
- BSTIM_ISR_UIF_Clr();
-
- }
-}
void LPTIM_IRQHandler(void) //�������ڼ��
{
if(SET == LPTIM_ISR_OVIF_Chk() && ENABLE == LPTIM_CR_EN_Getable())
{
LPTIM_ISR_OVIF_Clr(); /* ����������жϱ�־λ */
-// button_ticks();//ִ��Buttonɨ��
+ button_ticks();//ִ��Buttonɨ��
}
}
@@ -155,6 +169,7 @@
BSTIM_CR1_ARPE_Setable(ENABLE); //Ԥװ��ʹ��
BSTIM_CR1_OPM_Set(BSTIM_CR1_OPM_STOP); //Update Event����ʱ������ֹͣ���Զ�����CEN��
+
BSTIM_PSCR_Write(Psc - 1);
BSTIM_ARR_Write(Arr - 1);
--
Gitblit v1.9.3