From 6fed6a034dc213eaac201894fe98036902460ddb Mon Sep 17 00:00:00 2001 From: stark1898y <1658608470@qq.com> Date: Tue, 3 Jun 2025 08:45:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- APP/peripheral.c | 6 ++++-- BSP/src/bsp_valve.c | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/APP/peripheral.c b/APP/peripheral.c index 4a42b03..429b583 100644 --- a/APP/peripheral.c +++ b/APP/peripheral.c @@ -730,7 +730,8 @@ static void peripheralStateNotificationCB(gapRole_States_t newState, gapRoleEven */ static void performPeriodicTask(void) { - if (boost_en_flag == 0 && GPIOA_ReadITFlagBit(BOOST_APIN) == 0) + // if (boost_en_flag == 0 && GPIOA_ReadITFlagBit(BOOST_APIN) == 0) + if (boost_en_flag == 0) { gValveData.bat = BSP_ReadVbat(); // TODO:温湿度传感器读错的话就不发了? @@ -763,7 +764,8 @@ static void performPeriodicTask(void) tmos_set_event(led_task_id, LED_SHOW_START_EVT); } - else if(GPIOA_ReadITFlagBit(BOOST_APIN) == 1) + // else if(GPIOA_ReadITFlagBit(BOOST_APIN) == 1) + else { tmos_start_task(Peripheral_TaskID, SBP_PERIODIC_EVT, MS1_TO_SYSTEM_TIME(1000)); } diff --git a/BSP/src/bsp_valve.c b/BSP/src/bsp_valve.c index e2609e5..58aee94 100644 --- a/BSP/src/bsp_valve.c +++ b/BSP/src/bsp_valve.c @@ -2,7 +2,7 @@ * @Author : stark1898y 1658608470@qq.com * @Date : 2024-12-15 15:01:15 * @LastEditors : stark1898y 1658608470@qq.com - * @LastEditTime : 2025-05-30 16:30:38 + * @LastEditTime : 2025-05-30 16:53:07 * @FilePath : \BLE_TYQ_CH584M\BSP\src\bsp_valve.c * @Description : * @@ -31,7 +31,7 @@ #undef LOG_TAG #define LOG_TAG "BSP_VALVE" -volatile uint8_t boost_en_flag; +volatile uint8_t boost_en_flag = 0; TsValveData gValveData = {0}; uint16_t bat_mv; @@ -537,7 +537,8 @@ static uint16_t VAVLE_Task_ProcessEvent(uint8_t task_id, uint16_t events) if (events & VAVLE_LOOP_DECT_EVT) { logDebug("VAVLE_LOOP_DECT_EVT"); - if (GPIOA_ReadITFlagBit(BOOST_APIN) == 0) + // if (GPIOA_ReadITFlagBit(BOOST_APIN) == 0) + if (boost_en_flag == 0) { // TODO:亮灯或者蜂鸣器的时候读电压就低了 gValveData.bat = BSP_ReadVbat();