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 | 64 +++++++++++++++++---------------
1 files changed, 34 insertions(+), 30 deletions(-)
diff --git a/HARDWARE/TIM/tim.c b/HARDWARE/TIM/tim.c
index 9a6b7a6..fdd86fd 100644
--- a/HARDWARE/TIM/tim.c
+++ b/HARDWARE/TIM/tim.c
@@ -1,37 +1,15 @@
#include "tim.h"
-
-
-
-
+#include "master_slave_inter.h"
+#include "power_manage.h"
+#include "valve_control.h"
+#include "multi_button.h"
#include "gpio.h"
uint8_t first_power_tim_cnt_g = 5;
-
-void BTx_IRQHandler(void)
-{
-// if( BTx_ISR_CMPHIF_Chk(BT1)==SET) //�춨����
-// {
-// BTx_ISR_CMPLIF_Clr(BT1);
-// BTx_ISR_CMPHIF_Clr(BT1);
-// 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)
-{
+//void BSTIM_IRQHandler(void)
+//{
+//
// if(BSTIM_ISR_UIF_Chk()!=RESET) //��/�ط�ʱ��
// {
// BSTIM_ISR_UIF_Clr();
@@ -44,14 +22,39 @@
// SYS_BST_DIS;
// }
// }
+//
+//}
+
+
+void BTx_IRQHandler(void)
+{
+ if( BTx_ISR_CMPHIF_Chk(BT1)==SET) //�춨����
+ {
+ BTx_ISR_CMPLIF_Clr(BT1);
+ BTx_ISR_CMPHIF_Clr(BT1);
+ 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 LPTIM_IRQHandler(void) //�������ڼ��
{
if(SET == LPTIM_ISR_OVIF_Chk() && ENABLE == LPTIM_CR_EN_Getable())
{
LPTIM_ISR_OVIF_Clr(); /* ����������жϱ�־λ */
-// button_ticks();//ִ��Buttonɨ��
+ button_ticks();//ִ��Buttonɨ��
}
}
@@ -166,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