This commit is contained in:
stark1898y 2024-12-17 16:48:34 +08:00
parent 19312b9ae0
commit 25410c9dee
4 changed files with 15 additions and 9 deletions

View File

@ -48,6 +48,8 @@ static uint8_t key_press_cnt = 0;
void app_task_handler(TeAppEvtType app_evt_type)
{
BSP_BlockSleep();
// BSP_BlockSleep();
BSP_RequestBoost();
switch(app_evt_type)
{
@ -66,7 +68,7 @@ void app_task_handler(TeAppEvtType app_evt_type)
// tmos_stop_task(led_task_id, LED_SHOW_ONCE_EVT);
// tmos_start_task(led_task_id, LED_SHOW_ONCE_EVT, 1000);
}
else if (key_press_cnt >= 2)
else if (key_press_cnt == 2)
{
if (gValveData.switch_status == kClosed)
{

View File

@ -2,7 +2,7 @@
* @Author : stark1898y 1658608470@qq.com
* @Date : 2024-12-09 09:50:56
* @LastEditors : stark1898y 1658608470@qq.com
* @LastEditTime : 2024-12-17 10:49:46
* @LastEditTime : 2024-12-17 16:12:04
* @FilePath : \BLE_TYQ_CH592F\BSP\inc\bsp_beep_led_emv.h
* @Description :
*
@ -99,7 +99,7 @@ extern tmosTaskID led_task_id;
do \
{ \
GPIOB_ResetBits(GPIO_Pin_13); \
GPIOB_ModeCfg(GPIO_Pin_13, GPIO_ModeIN_Floating); \
GPIOB_ModeCfg(GPIO_Pin_13, GPIO_ModeIN_PD); \
} while (0);
// EMV_EN

View File

@ -2,7 +2,7 @@
* @Author : stark1898y 1658608470@qq.com
* @Date : 2024-12-12 15:55:38
* @LastEditors : stark1898y 1658608470@qq.com
* @LastEditTime : 2024-12-17 14:14:36
* @LastEditTime : 2024-12-17 15:51:09
* @FilePath : \BLE_TYQ_CH592F\BSP\inc\bsp_valve.h
* @Description :
*
@ -34,7 +34,7 @@ extern tmosTaskID vavle_task_id;
#define CHARGE_TIME_MS 1000
#define CHARGE_TIME_MS (1500)
// 2.2V
#define LOW_VABAT_ALARM_VALUE 22

View File

@ -2,7 +2,7 @@
* @Author : stark1898y 1658608470@qq.com
* @Date : 2024-12-15 15:01:15
* @LastEditors : stark1898y 1658608470@qq.com
* @LastEditTime : 2024-12-17 14:36:52
* @LastEditTime : 2024-12-17 16:12:13
* @FilePath : \BLE_TYQ_CH592F\BSP\src\bsp_valve.c
* @Description :
*
@ -340,6 +340,7 @@ static uint16_t VAVLE_Task_ProcessEvent(uint8_t task_id, uint16_t events)
{
logDebug("VAVLE_CLOSE_START_EVT");
BSP_BlockSleep();
BSP_RequestBoost();
DelayMs(1);
@ -355,12 +356,15 @@ static uint16_t VAVLE_Task_ProcessEvent(uint8_t task_id, uint16_t events)
}
if (events & VAVLE_CLOSE_ACTION_EVT)
{
BSP_BlockSleep();
BSP_RequestBoost();
logDebug("VAVLE_CLOSE_ACTION_EVT");
BEEP_ON;
// 关阀动作
// 关阀动作,一定要先关充电的防止其他12V用电
EMV_CHARGE_OFF_DEINIT;
logDebug("EMV_CHARGE_OFF_DEINIT");
BEEP_ON;
// EMV_CTRL
EMV_ON;
logDebug("EMV_ON");
@ -428,7 +432,7 @@ void BSP_VAVLE_Init(void)
tmos_memset(&gValveData, 0, sizeof(gValveData));
gValveData.switch_status = kUnknown;
gValveData.switch_status = kClosed;
gValveData.temp = -100;
gValveData.in_pressure = 0;
gValveData.out_pressure = 0;