连上叫一下亮灯300ms

This commit is contained in:
stark1898y 2025-04-14 00:25:10 +08:00
parent c138885fdc
commit c102d12976
5 changed files with 39 additions and 6 deletions

View File

@ -661,6 +661,13 @@ static void peripheralStateNotificationCB(gapRole_States_t newState, gapRoleEven
}; };
GATT_ExchangeMTU(peripheralConnList.connHandle, &req, Peripheral_TaskID); GATT_ExchangeMTU(peripheralConnList.connHandle, &req, Peripheral_TaskID);
// Peripheral_SetMacName(); // Peripheral_SetMacName();
// BSP_BlockSleep();
// BSP_RequestBoost();
// DelayMs(1);
// // ShowLed();
// BEEP_ON;
// DelayMs(500);
tmos_set_event(led_task_id, CONNECT_BEEP_START_EVT);
} }
break; break;

View File

@ -25,6 +25,9 @@ extern tmosTaskID led_task_id;
#define LOW_VBAT_EVT (0x0001 << 4) #define LOW_VBAT_EVT (0x0001 << 4)
#define HIGH_TEMP_EVT (0x0001 << 5) #define HIGH_TEMP_EVT (0x0001 << 5)
#define CONNECT_BEEP_START_EVT (0x0001 << 6)
#define CONNECT_BEEP_END_EVT (0x0001 << 7)
/**********************BOOST 12V_EN PA1************************ */ /**********************BOOST 12V_EN PA1************************ */
#define BOOST_EN \ #define BOOST_EN \

View File

@ -2,7 +2,7 @@
* @Author : stark1898y 1658608470@qq.com * @Author : stark1898y 1658608470@qq.com
* @Date : 2024-12-12 15:55:38 * @Date : 2024-12-12 15:55:38
* @LastEditors : stark1898y 1658608470@qq.com * @LastEditors : stark1898y 1658608470@qq.com
* @LastEditTime : 2025-02-24 16:39:07 * @LastEditTime : 2025-04-14 00:18:32
* @FilePath : \BLE_TYQ_CH584M\BSP\inc\bsp_valve.h * @FilePath : \BLE_TYQ_CH584M\BSP\inc\bsp_valve.h
* @Description : * @Description :
* *
@ -32,14 +32,11 @@ extern tmosTaskID vavle_task_id;
#define VAVLE_DECT_SWITCH_CALIB_EVT (0x0001 << 9) // 标定电磁铁 #define VAVLE_DECT_SWITCH_CALIB_EVT (0x0001 << 9) // 标定电磁铁
#define VALVE_LOW_VBAT_ALARM_PERIOD_MS (1600 * 60 * 10) #define VALVE_LOW_VBAT_ALARM_PERIOD_MS (1600 * 60 * 10)
#define VALVE_DECT_PERIOD_MS (1600 * 60 * 10) #define VALVE_DECT_PERIOD_MS (1600 * 60 * 10)
#define CHARGE_TIME_MS (1500) #define CHARGE_TIME_MS (1500)
// 2.2V // 2.2V

View File

@ -63,7 +63,7 @@ static tmosEvents LED_Task_ProcessEvent(tmosTaskID taskID, tmosEvents event)
DelayMs(3); DelayMs(3);
ShowLed(); ShowLed();
tmos_stop_task(led_task_id, LED_SHOW_ONCE_EVT); tmos_stop_task(led_task_id, LED_SHOW_ONCE_EVT);
tmos_start_task(led_task_id, LED_SHOW_ONCE_EVT, 1000); tmos_start_task(led_task_id, LED_SHOW_ONCE_EVT, MS1_TO_SYSTEM_TIME(1000));
return (event ^ LED_SHOW_START_EVT); return (event ^ LED_SHOW_START_EVT);
} }
if (event & LED_SHOW_ONCE_EVT) if (event & LED_SHOW_ONCE_EVT)
@ -99,8 +99,34 @@ static tmosEvents LED_Task_ProcessEvent(tmosTaskID taskID, tmosEvents event)
LED_Y_ON; LED_Y_ON;
return (event ^ LOW_VBAT_EVT); return (event ^ LOW_VBAT_EVT);
} }
if (event & CONNECT_BEEP_START_EVT)
{
logDebug("CONNECT_BEEP_START_EVT");
LED_G_ON;
BSP_BlockSleep();
BSP_RequestBoost();
BEEP_ON;
tmos_start_task(led_task_id, CONNECT_BEEP_END_EVT, MS1_TO_SYSTEM_TIME(300));
return (event ^ CONNECT_BEEP_START_EVT);
}
if(event & CONNECT_BEEP_END_EVT)
{
logDebug("CONNECT_BEEP_END_EVT");
LED_ALL_OFF_DEINIT;
BEEP_OFF_DEINIT;
BSP_NoNeedBoost();
BSP_RequestSleep();
// BEEP_OFF_DEINIT;
// EMV_CHARGE_OFF_DEINIT;
// EMV_OFF_DEINIT;
return (event ^ CONNECT_BEEP_END_EVT);
}
} }

View File

@ -2,7 +2,7 @@
* @Author : stark1898y 1658608470@qq.com * @Author : stark1898y 1658608470@qq.com
* @Date : 2024-12-15 15:01:15 * @Date : 2024-12-15 15:01:15
* @LastEditors : stark1898y 1658608470@qq.com * @LastEditors : stark1898y 1658608470@qq.com
* @LastEditTime : 2025-02-24 17:58:40 * @LastEditTime : 2025-04-14 00:16:50
* @FilePath : \BLE_TYQ_CH584M\BSP\src\bsp_valve.c * @FilePath : \BLE_TYQ_CH584M\BSP\src\bsp_valve.c
* @Description : * @Description :
* *