代码暂存 初步调通主机通过蓝牙开关阀门功能
This commit is contained in:
parent
2f38a342f3
commit
c64199ccd9
|
@ -5,7 +5,7 @@
|
|||
"type": "mrs-debugger",
|
||||
"request": "launch",
|
||||
"name": "IoT_SCV_CH584M1",
|
||||
"cwd": "c:\\Users\\123\\Desktop\\物联网自闭阀\\iot_-scv_-ch584-m",
|
||||
"cwd": "c:\\Users\\123\\Desktop\\自闭阀项目\\蓝牙调试\\iot_-scv_-ch584-m",
|
||||
"openOCDCfg": {
|
||||
"useLocalOpenOCD": true,
|
||||
"executable": "d:/MounRiverV2/MounRiver_Studio2/resources/app/resources/win32/components/WCH/OpenOCD/OpenOCD/bin/openocd.exe",
|
||||
|
@ -39,8 +39,8 @@
|
|||
"additionalCommands": []
|
||||
},
|
||||
"loadedFiles": {
|
||||
"executableFile": "c:\\Users\\123\\Desktop\\物联网自闭阀\\iot_-scv_-ch584-m\\obj\\IoT_SCV_CH584M1.elf",
|
||||
"symbolFile": "c:\\Users\\123\\Desktop\\物联网自闭阀\\iot_-scv_-ch584-m\\obj\\IoT_SCV_CH584M1.elf",
|
||||
"executableFile": "c:\\Users\\123\\Desktop\\自闭阀项目\\蓝牙调试\\iot_-scv_-ch584-m\\obj\\IoT_SCV_CH584M1.elf",
|
||||
"symbolFile": "c:\\Users\\123\\Desktop\\自闭阀项目\\蓝牙调试\\iot_-scv_-ch584-m\\obj\\IoT_SCV_CH584M1.elf",
|
||||
"executableFileOffset": 0,
|
||||
"symbolFileOffset": 0
|
||||
},
|
||||
|
|
|
@ -32,6 +32,8 @@ extern "C" {
|
|||
#define SBP_PARAM_UPDATE_EVT 0x0008
|
||||
#define SBP_PHY_UPDATE_EVT 0x0010
|
||||
|
||||
#define SBP_REPLY_CMD_EVT 0x0020
|
||||
extern uint8_t Peripheral_TaskID;
|
||||
/*********************************************************************
|
||||
* MACROS
|
||||
*/
|
||||
|
|
144
APP/peripheral.c
144
APP/peripheral.c
|
@ -19,6 +19,17 @@
|
|||
#include "gattprofile.h"
|
||||
#include "peripheral.h"
|
||||
#include "bsp_iwdg.h"
|
||||
#include "bsp_valve.h"
|
||||
#include "bsp_uart.h"
|
||||
#include "log.h"
|
||||
#include "bsp_adc.h"
|
||||
#include "bsp_led.h"
|
||||
#include "SLEEP.h"
|
||||
#include <stdbool.h>
|
||||
#undef LOG_ENABLE
|
||||
#define LOG_ENABLE 1
|
||||
#undef LOG_TAG
|
||||
#define LOG_TAG "peripheral"
|
||||
/*********************************************************************
|
||||
* MACROS
|
||||
*/
|
||||
|
@ -61,6 +72,8 @@
|
|||
// Company Identifier: WCH
|
||||
#define WCH_COMPANY_ID 0x07D7
|
||||
|
||||
#define MAC_NAME "ZBF-93:B4:8F:10:53:5C"
|
||||
#define MAC_NAME_LEN 22
|
||||
/*********************************************************************
|
||||
* TYPEDEFS
|
||||
*/
|
||||
|
@ -68,7 +81,17 @@
|
|||
/*********************************************************************
|
||||
* GLOBAL VARIABLES
|
||||
*/
|
||||
volatile uint8_t mtu_flag = 0;
|
||||
static volatile bool periodic_upload_block_flag = false;
|
||||
|
||||
void BSP_NeeedReplyCMdFirst(void)
|
||||
{
|
||||
periodic_upload_block_flag = true;
|
||||
}
|
||||
void BSP_NoNeeedReplyCMd(void)
|
||||
{
|
||||
periodic_upload_block_flag = false;
|
||||
}
|
||||
/*********************************************************************
|
||||
* EXTERNAL VARIABLES
|
||||
*/
|
||||
|
@ -80,19 +103,19 @@
|
|||
/*********************************************************************
|
||||
* LOCAL VARIABLES
|
||||
*/
|
||||
static uint8_t Peripheral_TaskID = INVALID_TASK_ID; // Task ID for internal task/event processing
|
||||
uint8_t Peripheral_TaskID = INVALID_TASK_ID; // ????/???????ID
|
||||
|
||||
// GAP - SCAN RSP data (max size = 31 bytes)
|
||||
static uint8_t scanRspData[] = {
|
||||
// complete name
|
||||
0x12, // length of this data
|
||||
GAP_ADTYPE_LOCAL_NAME_COMPLETE,
|
||||
'S',
|
||||
'i',
|
||||
'm',
|
||||
'p',
|
||||
'l',
|
||||
'e',
|
||||
'I',
|
||||
'o',
|
||||
'T',
|
||||
'z',
|
||||
'b',
|
||||
'f',
|
||||
' ',
|
||||
'P',
|
||||
'e',
|
||||
|
@ -137,7 +160,7 @@ static uint8_t advertData[] = {
|
|||
};
|
||||
|
||||
// GAP GATT Attributes
|
||||
static uint8_t attDeviceName[GAP_DEVICE_NAME_LEN] = "Simple Peripheral";
|
||||
static uint8_t attDeviceName[GAP_DEVICE_NAME_LEN] = "IoTzbf Peripheral";
|
||||
|
||||
// Connection item list
|
||||
static peripheralConnItem_t peripheralConnList;
|
||||
|
@ -259,11 +282,11 @@ void Peripheral_Init()
|
|||
|
||||
// Setup the SimpleProfile Characteristic Values
|
||||
{
|
||||
uint8_t charValue1[SIMPLEPROFILE_CHAR1_LEN] = {1};
|
||||
uint8_t charValue2[SIMPLEPROFILE_CHAR2_LEN] = {2};
|
||||
uint8_t charValue3[SIMPLEPROFILE_CHAR3_LEN] = {3};
|
||||
uint8_t charValue4[SIMPLEPROFILE_CHAR4_LEN] = {4};
|
||||
uint8_t charValue5[SIMPLEPROFILE_CHAR5_LEN] = {1, 2, 3, 4, 5};
|
||||
uint8_t charValue1[SIMPLEPROFILE_CHAR1_LEN] = {0};
|
||||
uint8_t charValue2[SIMPLEPROFILE_CHAR2_LEN] = {0};
|
||||
uint8_t charValue3[SIMPLEPROFILE_CHAR3_LEN] = {0};
|
||||
uint8_t charValue4[SIMPLEPROFILE_CHAR4_LEN] = {0};
|
||||
uint8_t charValue5[SIMPLEPROFILE_CHAR5_LEN] = {0, 0, 0, 0, 0};
|
||||
|
||||
SimpleProfile_SetParameter(SIMPLEPROFILE_CHAR1, SIMPLEPROFILE_CHAR1_LEN, charValue1);
|
||||
SimpleProfile_SetParameter(SIMPLEPROFILE_CHAR2, SIMPLEPROFILE_CHAR2_LEN, charValue2);
|
||||
|
@ -287,6 +310,7 @@ void Peripheral_Init()
|
|||
// 注册广播事件和连接事件回调函数
|
||||
LL_AdvertiseEventRegister(BLE_AdvertiseEventCB);
|
||||
LL_ConnectEventRegister(BLE_ConnectEventCB);
|
||||
GATT_InitClient();
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
@ -343,16 +367,26 @@ uint16_t Peripheral_ProcessEvent(uint8_t task_id, uint16_t events)
|
|||
GAPRole_PeripheralStartDevice(Peripheral_TaskID, &Peripheral_BondMgrCBs, &Peripheral_PeripheralCBs);
|
||||
return (events ^ SBP_START_DEVICE_EVT);
|
||||
}
|
||||
if(events & SBP_REPLY_CMD_EVT)
|
||||
{
|
||||
logDebug("SBP_REPLY_CMD_EVT");
|
||||
peripheralChar4Notify((uint8_t *)&RelyData.buf[0], RelyData.len);
|
||||
BSP_NoNeeedReplyCMd();
|
||||
return (events ^ SBP_REPLY_CMD_EVT);
|
||||
}
|
||||
|
||||
if(events & SBP_PERIODIC_EVT)
|
||||
{
|
||||
// Restart timer
|
||||
if(SBP_PERIODIC_EVT_PERIOD)
|
||||
if(periodic_upload_block_flag == false && mtu_flag == 1)
|
||||
{
|
||||
performPeriodicTask();
|
||||
tmos_start_task(Peripheral_TaskID, SBP_PERIODIC_EVT, SBP_PERIODIC_EVT_PERIOD);
|
||||
}
|
||||
// Perform periodic application task
|
||||
performPeriodicTask();
|
||||
else
|
||||
{
|
||||
tmos_start_task(Peripheral_TaskID, SBP_PERIODIC_EVT, 1600 * 1);
|
||||
}
|
||||
return (events ^ SBP_PERIODIC_EVT);
|
||||
}
|
||||
|
||||
|
@ -448,7 +482,8 @@ static void Peripheral_ProcessTMOSMsg(tmos_event_hdr_t *pMsg)
|
|||
if(pMsgEvent->method == ATT_MTU_UPDATED_EVENT)
|
||||
{
|
||||
peripheralMTU = pMsgEvent->msg.exchangeMTUReq.clientRxMTU;
|
||||
PRINT("mtu exchange: %d\n", pMsgEvent->msg.exchangeMTUReq.clientRxMTU);
|
||||
mtu_flag = 1;
|
||||
logDebug("****mtu exchange: %d****", pMsgEvent->msg.exchangeMTUReq.clientRxMTU);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -492,8 +527,13 @@ static void Peripheral_LinkEstablished(gapRoleEvent_t *pEvent)
|
|||
|
||||
// Start read rssi
|
||||
tmos_start_task(Peripheral_TaskID, SBP_READ_RSSI_EVT, SBP_READ_RSSI_EVT_PERIOD);
|
||||
attExchangeMTUReq_t req = {
|
||||
.clientRxMTU = BLE_BUFF_MAX_LEN - 4,
|
||||
};
|
||||
GATT_ExchangeMTU(peripheralConnList.connHandle, &req, Peripheral_TaskID);
|
||||
enable_notify(peripheralConnList.connHandle, ENABLE);
|
||||
|
||||
PRINT("Conn %x - Int %x \n", event->connectionHandle, event->connInterval);
|
||||
logDebug("Conn %x - Int %x= %.1fms", event->connectionHandle, event->connInterval, event->connInterval * 1.25);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -518,6 +558,7 @@ static void Peripheral_LinkTerminated(gapRoleEvent_t *pEvent)
|
|||
peripheralConnList.connTimeout = 0;
|
||||
tmos_stop_task(Peripheral_TaskID, SBP_PERIODIC_EVT);
|
||||
tmos_stop_task(Peripheral_TaskID, SBP_READ_RSSI_EVT);
|
||||
mtu_flag = 0;
|
||||
|
||||
// Restart advertising
|
||||
{
|
||||
|
@ -527,7 +568,7 @@ static void Peripheral_LinkTerminated(gapRoleEvent_t *pEvent)
|
|||
}
|
||||
else
|
||||
{
|
||||
PRINT("ERR..\n");
|
||||
logError("ERR..");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -543,7 +584,8 @@ static void Peripheral_LinkTerminated(gapRoleEvent_t *pEvent)
|
|||
*/
|
||||
static void peripheralRssiCB(uint16_t connHandle, int8_t rssi)
|
||||
{
|
||||
PRINT("RSSI -%d dB Conn %x \n", -rssi, connHandle);
|
||||
gValveData.rssi = rssi;
|
||||
logDebug("RSSI %d dB Conn %x ", gValveData.rssi, connHandle);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
@ -567,11 +609,12 @@ static void peripheralParamUpdateCB(uint16_t connHandle, uint16_t connInterval,
|
|||
peripheralConnList.connSlaveLatency = connSlaveLatency;
|
||||
peripheralConnList.connTimeout = connTimeout;
|
||||
|
||||
PRINT("Update %x - Int %x \n", connHandle, connInterval);
|
||||
logDebug("ParamUpdateCB (Handle)%x - (connInt 0x%x=%.1fms) - (connSlaveLatency) %x - (connTimeout 0x%x=%dms)",
|
||||
connHandle, connInterval, connInterval * 1.25, connSlaveLatency, connTimeout * 10, connTimeout * 10);
|
||||
}
|
||||
else
|
||||
{
|
||||
PRINT("ERR..\n");
|
||||
logError("ERR..");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -672,8 +715,22 @@ static void peripheralStateNotificationCB(gapRole_States_t newState, gapRoleEven
|
|||
*/
|
||||
static void performPeriodicTask(void)
|
||||
{
|
||||
uint8_t notiData[SIMPLEPROFILE_CHAR4_LEN] = {0x88};
|
||||
peripheralChar4Notify(notiData, SIMPLEPROFILE_CHAR4_LEN);
|
||||
// ??????
|
||||
gValveData.bat = BSP_ReadVbat();
|
||||
if (gValveData.bat <= LOW_VABAT_CLOSE_VALUE)
|
||||
{
|
||||
gValveData.switch_status = kClosed;
|
||||
tmos_set_event(vavle_task_id, VAVLE_CLOSE_START_EVT);
|
||||
}
|
||||
else if (gValveData.bat <= LOW_VABAT_ALARM_VALUE)
|
||||
{
|
||||
tmos_set_event(vavle_task_id, VAVLE_LOW_VBAT_ALARM_EVT);
|
||||
}
|
||||
logDebug("switch_status:%d Temp:%d Bat:%d Humi:%d%% RSSI: %d",
|
||||
gValveData.switch_status, gValveData.temp, gValveData.bat, gValveData.humi, gValveData.rssi);
|
||||
TsRawFrameData RawData;
|
||||
BSP_VALVE_Generate_UploadData(&RawData);
|
||||
peripheralChar4Notify(&RawData.buf[0], RawData.len);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
@ -719,21 +776,52 @@ static void peripheralChar4Notify(uint8_t *pValue, uint16_t len)
|
|||
*/
|
||||
static void simpleProfileChangeCB(uint8_t paramID, uint8_t *pValue, uint16_t len)
|
||||
{
|
||||
BSP_NeeedReplyCMdFirst();
|
||||
switch(paramID)
|
||||
{
|
||||
case SIMPLEPROFILE_CHAR1:
|
||||
{
|
||||
uint8_t newValue[SIMPLEPROFILE_CHAR1_LEN];
|
||||
tmos_memcpy(newValue, pValue, len);
|
||||
PRINT("profile ChangeCB CHAR1.. \n");
|
||||
logDebug("profile ChangeCB CHAR1.. Start");
|
||||
for (uint8_t i = 0; i < len; i++)
|
||||
{
|
||||
logDebug("%02x ", newValue[i]);
|
||||
}
|
||||
logDebug("\n profile ChangeCB CHAR1.. End");
|
||||
break;
|
||||
}
|
||||
|
||||
case SIMPLEPROFILE_CHAR3:
|
||||
{
|
||||
uint8_t newValue[SIMPLEPROFILE_CHAR3_LEN];
|
||||
tmos_memcpy(newValue, pValue, len);
|
||||
PRINT("profile ChangeCB CHAR3..\n");
|
||||
logDebug("CHAR3 Start");
|
||||
uint8_t *p_rev_msg;
|
||||
p_rev_msg = tmos_msg_allocate(len + 1);
|
||||
if (p_rev_msg)
|
||||
{
|
||||
p_rev_msg[0] = len;
|
||||
tmos_memcpy(&p_rev_msg[1], pValue, len);
|
||||
|
||||
logDebug("rece data len: %d", len);
|
||||
for (uint8_t i = 0; i < len; i++) {
|
||||
logDebug("pValue%d: 0x%02X", i, pValue[i]);
|
||||
}
|
||||
|
||||
int ret = tmos_msg_send(vavle_task_id, p_rev_msg);
|
||||
if (ret == SUCCESS)
|
||||
{
|
||||
logDebug("p_rev_msg send ret = %d", ret);
|
||||
}
|
||||
else
|
||||
{
|
||||
logError("p_rev_msg send ret = %d", ret);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
logError("????");
|
||||
}
|
||||
logDebug("profile ChangeCB CHAR3.. End");
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "bsp_led.h"
|
||||
#include "bsp_key.h"
|
||||
#include "bsp_iwdg.h"
|
||||
#include "bsp_valve.h"
|
||||
#include "log.h"
|
||||
|
||||
#undef LOG_ENABLE
|
||||
|
@ -104,6 +105,9 @@ int main(void)
|
|||
|
||||
BSP_MOTOR_Init();
|
||||
VALVE_OPEN();
|
||||
DelayMs(2000);
|
||||
|
||||
BSP_VAVLE_Init();
|
||||
|
||||
BSP_LED_Init();
|
||||
|
||||
|
|
|
@ -726,5 +726,21 @@ static void simpleProfile_HandleConnStatusCB(uint16_t connHandle, uint8_t change
|
|||
}
|
||||
}
|
||||
|
||||
// https://www.cnblogs.com/ZYL-FS/p/17759138.html
|
||||
// 定义使能通知函数(connection_handle连接句柄,表示要进行操作的连接)
|
||||
uint8_t enable_notify(uint16_t connection_handle, uint8_t enable)
|
||||
{
|
||||
uint16_t cccd = 0; //定义一个变量cccd,特征的配置值
|
||||
//判断是否使能通知
|
||||
if(enable) //使能
|
||||
{
|
||||
cccd |= GATT_CLIENT_CFG_NOTIFY; //将cccd置为使能通知的值
|
||||
}
|
||||
else
|
||||
{
|
||||
cccd &= ~GATT_CLIENT_CFG_NOTIFY; //不使能,将cccd置为禁止通知的值
|
||||
}
|
||||
return GATTServApp_WriteCharCfg( connection_handle, simpleProfileChar4Config, cccd); //将特征配置值写入到连接句柄,以实现通知的使能或禁用
|
||||
}
|
||||
/*********************************************************************
|
||||
*********************************************************************/
|
||||
|
|
|
@ -46,11 +46,11 @@ extern "C" {
|
|||
#define SIMPLEPROFILE_SERVICE 0x00000001
|
||||
|
||||
// Length of characteristic in bytes ( Default MTU is 23 )
|
||||
#define SIMPLEPROFILE_CHAR1_LEN 1
|
||||
#define SIMPLEPROFILE_CHAR2_LEN 1
|
||||
#define SIMPLEPROFILE_CHAR3_LEN 1
|
||||
#define SIMPLEPROFILE_CHAR4_LEN 1
|
||||
#define SIMPLEPROFILE_CHAR5_LEN 5
|
||||
#define SIMPLEPROFILE_CHAR1_LEN 64
|
||||
#define SIMPLEPROFILE_CHAR2_LEN 64
|
||||
#define SIMPLEPROFILE_CHAR3_LEN 64
|
||||
#define SIMPLEPROFILE_CHAR4_LEN 64
|
||||
#define SIMPLEPROFILE_CHAR5_LEN 64
|
||||
|
||||
/*********************************************************************
|
||||
* TYPEDEFS
|
||||
|
@ -125,6 +125,7 @@ extern bStatus_t SimpleProfile_GetParameter(uint8_t param, void *value);
|
|||
*/
|
||||
extern bStatus_t simpleProfile_Notify(uint16_t connHandle, attHandleValueNoti_t *pNoti);
|
||||
|
||||
extern uint8_t enable_notify(uint16_t connection_handle, uint8_t enable);
|
||||
/*********************************************************************
|
||||
*********************************************************************/
|
||||
|
||||
|
|
|
@ -20,4 +20,5 @@ void BSP_VBAT_Init(void);
|
|||
void Send_Low_Battery_Message(float vbat);
|
||||
void Handle_Low_Battery(float vbat);
|
||||
|
||||
uint8_t BSP_ReadVbat(void);
|
||||
#endif /* INCLUDE_BSP_ADC_H_ */
|
||||
|
|
|
@ -0,0 +1,125 @@
|
|||
/*
|
||||
* @Author : stark1898y 1658608470@qq.com
|
||||
* @Date : 2024-12-12 15:55:38
|
||||
* @LastEditors : stark1898y 1658608470@qq.com
|
||||
* @LastEditTime : 2025-02-24 16:39:07
|
||||
* @FilePath : \BLE_TYQ_CH584M\BSP\inc\bsp_valve.h
|
||||
* @Description :
|
||||
*
|
||||
* Copyright (c) 2024 by yzy, All Rights Reserved.
|
||||
*/
|
||||
#ifndef __BSP_VALVE_H__
|
||||
#define __BSP_VALVE_H__
|
||||
|
||||
#include "CONFIG.h"
|
||||
|
||||
extern tmosTaskID vavle_task_id;
|
||||
|
||||
|
||||
#define VAVLE_RX_DATA_EVT (0x0001 << 0)
|
||||
#define VAVLE_TX_DATA_EVT (0x0001 << 1)
|
||||
|
||||
#define VAVLE_CLOSE_START_EVT (0x0001 << 2) // 关阀,开始准备
|
||||
#define VAVLE_CLOSE_ACTION_EVT (0x0001 << 3) // 关阀,动作
|
||||
#define VAVLE_CLOSE_END_EVT (0x0001 << 4) // 关阀结束
|
||||
|
||||
#define VAVLE_OPEN_START_EVT (0x0001 << 5) // 开阀,开始准备
|
||||
#define VAVLE_OPEN_ACTION_EVT (0x0001 << 6) // 开阀,动作
|
||||
#define VAVLE_OPEN_END_EVT (0x0001 << 9) // 开阀结束
|
||||
|
||||
#define VAVLE_LOW_VBAT_ALARM_EVT (0x0001 << 7) // 低电压提醒
|
||||
|
||||
#define VAVLE_LOOP_DECT_EVT (0x0001 << 8) // 循环检测
|
||||
|
||||
#define VALVE_LOW_VBAT_ALARM_PERIOD_MS (1600 * 60 * 10)
|
||||
|
||||
#define VALVE_DECT_PERIOD_MS (1600 * 60 * 10)
|
||||
|
||||
|
||||
|
||||
#define CHARGE_TIME_MS (1500)
|
||||
|
||||
// 2.2V
|
||||
#define LOW_VABAT_ALARM_VALUE 22
|
||||
|
||||
#define LOW_VABAT_CLOSE_VALUE 20
|
||||
|
||||
|
||||
#define FRAME_HEADER 0xAA
|
||||
#define FRAME_TAIL 0x55
|
||||
|
||||
// 0xAA CMD/DATA/ DATA_LEN (DATA) checksum 0x55
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kCmdCfg = 0X01,
|
||||
kCmdCloseVavle,
|
||||
kCmdOpenVavle,
|
||||
kCmdData,
|
||||
} TeFrameCmd;
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
TeFrameCmd cmd; // CMD/DATA
|
||||
uint8_t len; // DATA_LEN
|
||||
// TsValveData data;
|
||||
uint8_t data[];
|
||||
} TsFrameData;
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint8_t len;
|
||||
uint8_t buf[64];
|
||||
} TsRawFrameData;
|
||||
|
||||
extern TsRawFrameData RelyData;
|
||||
|
||||
// 阀门类型
|
||||
typedef enum
|
||||
{
|
||||
kTyq = 0X01,
|
||||
kZbf,
|
||||
kDcf,
|
||||
} TeVavleType;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kUnknown = 0,
|
||||
kClosed,
|
||||
kOpened,
|
||||
kDisconnect,
|
||||
} TeValveSwitchStatus;
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
// uint8_t status; // 1B 阀门工作状态 超欠压、过流
|
||||
// uint8_t connct_status; // 1B 阀门连接状态 (电磁阀BLE控制盒) 0=未连接 1=已连接
|
||||
uint8_t switch_status; // 1B 阀门开关状态 0=未知 1=关闭=关闭过,未按按键恢复 2=关闭过,按下了恢复键 = 打开
|
||||
int8_t temp; // 1B 阀门温度 有符号整数 25 ℃
|
||||
|
||||
uint32_t in_pressure; // 4B 阀门入口压力 Pa
|
||||
uint32_t out_pressure; // 4B 阀门出口压力 Pa
|
||||
uint32_t atm_pressure; // 4B 阀门大气压力 Pa
|
||||
uint8_t type; // 阀门类型
|
||||
uint8_t bat; // 1B 电池电压 30=3V,18=1.8V
|
||||
uint8_t humi; // 1B 阀门湿度 %RH
|
||||
int8_t rssi;
|
||||
} TsValveData;
|
||||
extern TsValveData gValveData;
|
||||
|
||||
uint8_t CheckSum(const uint8_t *data, size_t len);
|
||||
|
||||
void BSP_VAVLE_Init(void);
|
||||
void BSP_CloseValve(void);
|
||||
void BSP_OpenValve(void);
|
||||
|
||||
TsFrameData* BSP_VAVLE_GetFrameData(uint8_t *data, uint8_t len);
|
||||
|
||||
uint8_t GenerateRawFrame(TsRawFrameData *pRawData, uint8_t cmd, const uint8_t *p_src, uint8_t src_len);
|
||||
|
||||
void BSP_VALVE_Generate_Data(TsRawFrameData *pRawData, uint8_t switch_status, uint8_t bat, int8_t temp, uint8_t humi);
|
||||
void BSP_VALVE_Generate_ValveResponse(TsRawFrameData *pRawData, TeFrameCmd cmd, uint8_t status);
|
||||
|
||||
void BSP_VALVE_Generate_UploadData(TsRawFrameData *pRawData);
|
||||
|
||||
#endif // ! __BSP_VALVE_H__
|
|
@ -166,3 +166,40 @@ void BSP_VBAT_Init(void)
|
|||
vbat_task_id = TMOS_ProcessEventRegister(VBAT_ProcessEvent);
|
||||
tmos_set_event(vbat_task_id, VBAT_EVT_START);
|
||||
}
|
||||
uint16_t adcBuff[40];
|
||||
volatile uint8_t adclen;
|
||||
volatile uint8_t DMA_end = 0;
|
||||
uint32_t countadc = 0;
|
||||
uint16_t min_number = 0;
|
||||
uint16_t max_number = 0;
|
||||
double voltage = 0;
|
||||
uint8_t BSP_ReadVbat(void)
|
||||
{
|
||||
uint8_t i;
|
||||
uint32_t CountBat = 0;
|
||||
ADC_InterBATSampInit();
|
||||
DelayUs(1);
|
||||
ADC_ExcutSingleConver();
|
||||
DelayUs(1);
|
||||
for (i = 0; i < 20; i++)
|
||||
{
|
||||
adcBuff[i] = ADC_ExcutSingleConver(); // 连续采样20次
|
||||
}
|
||||
for (i = 0; i < 20; i++)
|
||||
{
|
||||
CountBat += adcBuff[i];
|
||||
if (i == 0)
|
||||
{
|
||||
min_number = adcBuff[i];
|
||||
max_number = adcBuff[i];
|
||||
}
|
||||
min_number = ((min_number > adcBuff[i]) ? adcBuff[i] : min_number); // 软件滤波
|
||||
max_number = ((max_number < adcBuff[i]) ? adcBuff[i] : max_number);
|
||||
}
|
||||
logDebug("min_number = %d, max_number = %d", min_number, max_number);
|
||||
CountBat = (CountBat - min_number - max_number) / 18; // 删除最小与最大值
|
||||
CountBat = CountBat * 2.05078125 - 3150;
|
||||
uint8_t vbat = (uint8_t)(CountBat / 100);
|
||||
logDebug("AverageCountBat = %dmV, vbat = %d(100mV)", CountBat, vbat);
|
||||
return vbat;
|
||||
}
|
|
@ -391,13 +391,13 @@ void Lower_IO_Deinit(void)
|
|||
// SIM卡检测引脚配置为下拉输入
|
||||
GPIOB_ModeCfg(USIM_DECT_PIN, GPIO_ModeIN_PD);
|
||||
|
||||
//motor
|
||||
GPIOB_ResetBits(NSLEEP_PIN);
|
||||
GPIOB_ModeCfg(NSLEEP_PIN, GPIO_ModeIN_PD);
|
||||
//IN1 + ; IN2 +
|
||||
//GPIOB_SetBits(COIL_A);
|
||||
//GPIOB_SetBits(COIL_B);
|
||||
GPIOB_ModeCfg(COIL_A | COIL_B, GPIO_ModeIN_PD);
|
||||
// //motor
|
||||
// GPIOB_ResetBits(NSLEEP_PIN);
|
||||
// GPIOB_ModeCfg(NSLEEP_PIN, GPIO_ModeIN_PD);
|
||||
// //IN1 + ; IN2 +
|
||||
// //GPIOB_SetBits(COIL_A);
|
||||
// //GPIOB_SetBits(COIL_B);
|
||||
// GPIOB_ModeCfg(COIL_A | COIL_B, GPIO_ModeIN_PD);
|
||||
|
||||
// UART3
|
||||
// GPIOB_ModeCfg(GPIO_Pin_21 | GPIO_Pin_20, GPIO_ModeIN_PD);
|
||||
|
@ -744,7 +744,7 @@ uint16_t Check_ProcessEvent(uint8_t task_id, uint16_t events)
|
|||
//欠压检测
|
||||
if(P[0] - P[2] <= 80) //800
|
||||
{
|
||||
VALVE_CLOSE();
|
||||
// VALVE_CLOSE();
|
||||
fault_state = 2;
|
||||
tmos_start_task(check_task_id, MOTOR_STOP_EVT, MS1_TO_SYSTEM_TIME(1500)); //1000
|
||||
logDebug("motor low close");
|
||||
|
|
|
@ -0,0 +1,418 @@
|
|||
/*
|
||||
* @Author : stark1898y 1658608470@qq.com
|
||||
* @Date : 2024-12-15 15:01:15
|
||||
* @LastEditors : stark1898y 1658608470@qq.com
|
||||
* @LastEditTime : 2025-02-24 17:58:40
|
||||
* @FilePath : \BLE_TYQ_CH584M\BSP\src\bsp_valve.c
|
||||
* @Description :
|
||||
*
|
||||
* Copyright (c) 2024 by yzy, All Rights Reserved.
|
||||
*/
|
||||
#include "bsp_valve.h"
|
||||
#include "bsp_motor.h"
|
||||
// 0xAA CMD/DATA/ DATA_LEN (DATA) checksum 0x55
|
||||
|
||||
#include "bsp_uart.h"
|
||||
#include "log.h"
|
||||
#include "peripheral.h"
|
||||
#include "SLEEP.h"
|
||||
#include "bsp_adc.h"
|
||||
#include "bsp_led.h"
|
||||
|
||||
#undef LOG_ENABLE
|
||||
#define LOG_ENABLE 1
|
||||
|
||||
// #undef LOG_TAG
|
||||
// #define LOG_TAG "BSP_VALVE"
|
||||
|
||||
TsValveData gValveData = {0};
|
||||
TsRawFrameData RelyData;
|
||||
|
||||
tmosTaskID vavle_task_id = INVALID_TASK_ID;
|
||||
|
||||
#define ARRAY_SIZE(freq_arr) (sizeof(freq_arr) / sizeof((freq_arr)[0]))
|
||||
|
||||
/**
|
||||
* @description: From the frame start character to the sum of all bytes before the check code, modulo 256, i.e., the binary arithmetic sum of each byte without overflow value exceeding 255.
|
||||
* @param {uint8_t} *data
|
||||
* @param {uint16_t} len
|
||||
* @return {*}
|
||||
*/
|
||||
uint8_t CheckSum(const uint8_t *data, size_t len) // 计算校验和函数
|
||||
{
|
||||
uint8_t sum = 0;
|
||||
|
||||
for (size_t i = 0; i < len; i++)
|
||||
{
|
||||
sum += data[i];
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
|
||||
TsFrameData *BSP_VAVLE_GetFrameData(uint8_t *data, uint8_t len) // 获取阀门数据帧函数
|
||||
{
|
||||
int ret = 0;
|
||||
uint16_t index = 0;
|
||||
|
||||
TsFrameData *get_buffer = NULL;
|
||||
|
||||
if (len < 4)
|
||||
{
|
||||
logError("Data frame length insufficient");
|
||||
return NULL;
|
||||
}
|
||||
while (index < len && data[index] != FRAME_HEADER)
|
||||
{
|
||||
index++;
|
||||
}
|
||||
if (index >= len - 3)
|
||||
{
|
||||
logError("Data frame header error");
|
||||
return NULL;
|
||||
}
|
||||
uint16_t data_len = data[index + 2];
|
||||
if (index + 3 + data_len + 1 >= len)
|
||||
{
|
||||
logError("Data frame length error");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
uint8_t check_sum = data[index + 3 + data_len];
|
||||
uint8_t calculated_sum = CheckSum(&data[index], data_len + 3);
|
||||
if (check_sum != calculated_sum)
|
||||
{
|
||||
logError("Data frame checksum error check_sum = %02X, calculated_sum = %02X", check_sum, calculated_sum);
|
||||
return NULL;
|
||||
}
|
||||
if (data[index + 3 + data_len + 1] != FRAME_TAIL)
|
||||
{
|
||||
logError("Data frame tail error");
|
||||
return NULL;
|
||||
}
|
||||
logDebug("Data frame verification passed");
|
||||
|
||||
get_buffer = (TsFrameData *)tmos_msg_allocate(sizeof(TsFrameData) + sizeof(uint8_t) * data_len);
|
||||
if (get_buffer == NULL)
|
||||
{
|
||||
logError("tmos_msg_allocate fail");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
get_buffer->cmd = data[index + 1]; // 设置命令字段
|
||||
get_buffer->len = data_len; // 设置长度字段
|
||||
// get_buffer->data = data;
|
||||
|
||||
if (data_len > 0)
|
||||
{
|
||||
tmos_memcpy(get_buffer->data, &data[index + 3], data_len);
|
||||
return get_buffer;
|
||||
}
|
||||
|
||||
// //有效数据长度
|
||||
// size_t data_len = (data_len + 5);
|
||||
// //到这一步说明数据没问题,将接收到的数据通过中心任务发送出去
|
||||
// uint8_t *p_data;
|
||||
// p_data = tmos_msg_allocate(data_len);
|
||||
// if (p_data)
|
||||
// {
|
||||
// tmos_memcpy(p_data, data, data_len);
|
||||
// tmos_msg_send(BtRxTaskId, p_data);
|
||||
// tmos_start_task(BtRxTaskId, SYS_EVENT_MSG, 0);
|
||||
// }
|
||||
}
|
||||
|
||||
uint8_t GenerateRawFrame(TsRawFrameData *pRawData, uint8_t cmd, const uint8_t *p_src, uint8_t src_len) // 生成原始帧函数
|
||||
{
|
||||
pRawData->len = src_len + 5;
|
||||
|
||||
tmos_memset(pRawData->buf, 0, sizeof(pRawData->buf));
|
||||
|
||||
pRawData->buf[0] = FRAME_HEADER;
|
||||
pRawData->buf[1] = cmd;
|
||||
pRawData->buf[2] = src_len;
|
||||
|
||||
tmos_memcpy(&pRawData->buf[3], p_src, src_len);
|
||||
|
||||
pRawData->buf[pRawData->len - 2] = CheckSum(&pRawData->buf[0], pRawData->len - 2);
|
||||
pRawData->buf[pRawData->len - 1] = FRAME_TAIL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void BSP_VALVE_Generate_UploadData(TsRawFrameData *pRawData) // 生成上传数据函数
|
||||
{
|
||||
GenerateRawFrame(pRawData, kCmdData, (uint8_t *)&gValveData, sizeof(gValveData));
|
||||
}
|
||||
|
||||
void BSP_VALVE_Generate_Data(TsRawFrameData *pRawData, uint8_t switch_status, uint8_t bat, int8_t temp, uint8_t humi) // 生成阀门数据函数
|
||||
{
|
||||
TsValveData ValveData;
|
||||
|
||||
ValveData.switch_status = 0;
|
||||
ValveData.temp = temp;
|
||||
|
||||
ValveData.in_pressure = 0;
|
||||
ValveData.out_pressure = 0;
|
||||
ValveData.atm_pressure = 0;
|
||||
|
||||
ValveData.type = kTyq;
|
||||
ValveData.bat = bat;
|
||||
ValveData.humi = humi;
|
||||
|
||||
ValveData.rssi = 0;
|
||||
|
||||
GenerateRawFrame(pRawData, kCmdData, (uint8_t *)&ValveData, sizeof(ValveData));
|
||||
}
|
||||
|
||||
void BSP_VALVE_Generate_ValveResponse(TsRawFrameData *pRawData, TeFrameCmd cmd, uint8_t status) // 生成阀门响应函数
|
||||
{
|
||||
uint8_t data = 0;
|
||||
data = status;
|
||||
GenerateRawFrame(pRawData, cmd, &data, 1);
|
||||
}
|
||||
|
||||
void BSP_CloseValve(void)
|
||||
{
|
||||
VALVE_CLOSE();
|
||||
DelayMs(100);
|
||||
}
|
||||
|
||||
void BSP_OpenValve(void)
|
||||
{
|
||||
VALVE_OPEN();
|
||||
DelayMs(100);
|
||||
}
|
||||
|
||||
static void VAVLE_Task_ProcessTmosMsg(uint8_t *p_rev_msg) // 处理TMOS消息函数
|
||||
{
|
||||
if (p_rev_msg)
|
||||
{
|
||||
#if 1
|
||||
TsFrameData *HostFrameData = BSP_VAVLE_GetFrameData(&p_rev_msg[1], p_rev_msg[0]);
|
||||
if (HostFrameData != NULL)
|
||||
{
|
||||
switch (HostFrameData->cmd)
|
||||
{
|
||||
case kCmdCfg: // 配置命令
|
||||
logDebug("kCmdCfg");
|
||||
break;
|
||||
case kCmdCloseVavle: // 关阀命令
|
||||
logDebug("kCmdCloseVavle");
|
||||
tmos_set_event(vavle_task_id, VAVLE_CLOSE_START_EVT);
|
||||
|
||||
break;
|
||||
|
||||
case kCmdOpenVavle: // 开阀命令
|
||||
logDebug("kCmdOpenVavle");
|
||||
tmos_set_event(vavle_task_id, VAVLE_OPEN_START_EVT);
|
||||
break;
|
||||
default:
|
||||
logError("Invalid command");
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
logError("Data frame parsing failed");
|
||||
}
|
||||
tmos_msg_deallocate((uint8_t *)HostFrameData);
|
||||
HostFrameData = NULL;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
logError("pMsg is NULL");
|
||||
}
|
||||
}
|
||||
|
||||
static uint16_t VAVLE_Task_ProcessEvent(uint8_t task_id, uint16_t events) // 阀门任务事件处理函数
|
||||
{
|
||||
if (events & SYS_EVENT_MSG) // 系统消息事件
|
||||
{
|
||||
uint8_t *p_rev_msg;
|
||||
if ((p_rev_msg = tmos_msg_receive(vavle_task_id)) != NULL)
|
||||
{
|
||||
VAVLE_Task_ProcessTmosMsg(p_rev_msg);
|
||||
tmos_msg_deallocate(p_rev_msg);
|
||||
}
|
||||
return (events ^ SYS_EVENT_MSG);
|
||||
}
|
||||
if (events & VAVLE_RX_DATA_EVT) // 阀门接收数据事件
|
||||
{
|
||||
logDebug("VAVLE_RX_DATA_EVT");
|
||||
|
||||
return (events ^ VAVLE_RX_DATA_EVT);
|
||||
}
|
||||
if (events & VAVLE_TX_DATA_EVT) // 阀门发送数据事件
|
||||
{
|
||||
logDebug("VAVLE_TX_DATA_EVT");
|
||||
|
||||
return (events ^ VAVLE_TX_DATA_EVT);
|
||||
}
|
||||
if (events & VAVLE_CLOSE_START_EVT) // 阀门关闭开始事件
|
||||
{
|
||||
logDebug("VAVLE_CLOSE_START_EVT");
|
||||
|
||||
BSP_BlockSleep();
|
||||
DelayUs(200);
|
||||
|
||||
VALVE_STOP();
|
||||
|
||||
logDebug("MOTOR_INIT");
|
||||
|
||||
tmos_start_task(vavle_task_id, VAVLE_CLOSE_ACTION_EVT, MS1_TO_SYSTEM_TIME(CHARGE_TIME_MS));
|
||||
|
||||
return (events ^ VAVLE_CLOSE_START_EVT);
|
||||
}
|
||||
if (events & VAVLE_CLOSE_ACTION_EVT) // 阀门关闭动作事件
|
||||
{
|
||||
BSP_BlockSleep();
|
||||
logDebug("VAVLE_CLOSE_ACTION_EVT");
|
||||
|
||||
VALVE_CLOSE();
|
||||
|
||||
logDebug("VALVE_CLOSE");
|
||||
|
||||
tmos_start_task(vavle_task_id, VAVLE_CLOSE_END_EVT, MS1_TO_SYSTEM_TIME(1600));
|
||||
|
||||
return (events ^ VAVLE_CLOSE_ACTION_EVT);
|
||||
}
|
||||
if (events & VAVLE_CLOSE_END_EVT) // 阀门关闭结束事件
|
||||
{
|
||||
VALVE_STOP();
|
||||
|
||||
LED_ALL_CLOSE;
|
||||
|
||||
gValveData.switch_status = kClosed;
|
||||
|
||||
tmos_memset(&RelyData, 0, sizeof(RelyData));
|
||||
BSP_VALVE_Generate_ValveResponse(&RelyData, kCmdCloseVavle, 1);
|
||||
|
||||
tmos_set_event(Peripheral_TaskID, SBP_REPLY_CMD_EVT);
|
||||
|
||||
BSP_RequestSleep();
|
||||
logDebug("VAVLE_CLOSE_END_EVT");
|
||||
return (events ^ VAVLE_CLOSE_END_EVT);
|
||||
}
|
||||
|
||||
if (events & VAVLE_OPEN_START_EVT) // 阀门打开开始事件
|
||||
{
|
||||
logDebug("VAVLE_OPEN_START_EVT");
|
||||
|
||||
BSP_BlockSleep();
|
||||
DelayUs(200);
|
||||
|
||||
VALVE_STOP();
|
||||
|
||||
logDebug("MOTOR_INIT");
|
||||
|
||||
tmos_start_task(vavle_task_id, VAVLE_OPEN_ACTION_EVT, MS1_TO_SYSTEM_TIME(CHARGE_TIME_MS));
|
||||
|
||||
return (events ^ VAVLE_OPEN_START_EVT);
|
||||
}
|
||||
|
||||
if (events & VAVLE_OPEN_ACTION_EVT) // 阀门打开动作事件
|
||||
{
|
||||
BSP_BlockSleep();
|
||||
logDebug("VAVLE_OPEN_ACTION_EVT");
|
||||
|
||||
VALVE_OPEN();
|
||||
|
||||
logDebug("VALVE_OPEN");
|
||||
|
||||
tmos_start_task(vavle_task_id, VAVLE_OPEN_END_EVT, MS1_TO_SYSTEM_TIME(1600));
|
||||
|
||||
return (events ^ VAVLE_OPEN_ACTION_EVT);
|
||||
}
|
||||
|
||||
if (events & VAVLE_OPEN_END_EVT) // 阀门打开结束事件
|
||||
{
|
||||
VALVE_STOP();
|
||||
|
||||
LED_ALL_CLOSE;
|
||||
|
||||
gValveData.switch_status = kOpened;
|
||||
|
||||
tmos_memset(&RelyData, 0, sizeof(RelyData));
|
||||
BSP_VALVE_Generate_ValveResponse(&RelyData, kCmdOpenVavle, 1);
|
||||
|
||||
tmos_set_event(Peripheral_TaskID, SBP_REPLY_CMD_EVT);
|
||||
BSP_RequestSleep();
|
||||
logDebug("VAVLE_OPEN_END_EVT");
|
||||
return (events ^ VAVLE_OPEN_END_EVT);
|
||||
}
|
||||
|
||||
if (events & VAVLE_LOOP_DECT_EVT) // 循环检测事件
|
||||
{
|
||||
logDebug("VAVLE_LOOP_DECT_EVT");
|
||||
|
||||
gValveData.bat = BSP_ReadVbat();
|
||||
|
||||
// 电压过低就关阀
|
||||
if (gValveData.bat <= LOW_VABAT_CLOSE_VALUE)
|
||||
{
|
||||
gValveData.switch_status = kClosed;
|
||||
tmos_set_event(vavle_task_id, VAVLE_CLOSE_START_EVT);
|
||||
}
|
||||
else if (gValveData.bat <= LOW_VABAT_ALARM_VALUE)
|
||||
{
|
||||
tmos_set_event(vavle_task_id, VAVLE_LOW_VBAT_ALARM_EVT);
|
||||
}
|
||||
tmos_start_task(vavle_task_id, VAVLE_LOOP_DECT_EVT, MS1_TO_SYSTEM_TIME(VALVE_DECT_PERIOD_MS));
|
||||
|
||||
return (events ^ VAVLE_LOOP_DECT_EVT);
|
||||
}
|
||||
|
||||
if (events & VAVLE_LOW_VBAT_ALARM_EVT) // 低电压报警事件
|
||||
{
|
||||
logDebug("VAVLE_LOW_VBAT_ALARM_EVT"); // 记录低电压报警事件的调试信息
|
||||
|
||||
// 以下是被注释掉的代码块
|
||||
// BSP_BlockSleep(); // 阻止系统进入睡眠模式
|
||||
// BSP_RequestBoost(); // 请求提升系统性能
|
||||
|
||||
// LED_ALL_OFF_DEINIT; // 关闭所有LED并反初始化
|
||||
// LED_Y_ON; // 打开黄色LED
|
||||
|
||||
// BEEP_ON; // 打开蜂鸣器
|
||||
|
||||
// DelayMs(10); // 延时10毫秒
|
||||
|
||||
// LED_ALL_OFF_DEINIT; // 关闭所有LED并反初始化
|
||||
// BEEP_OFF_DEINIT; // 关闭蜂鸣器并反初始化
|
||||
|
||||
// BSP_NoNeedBoost(); // 取消系统性能提升请求
|
||||
// BSP_RequestSleep(); // 请求系统进入睡眠模式
|
||||
|
||||
// tmos_set_event(vavle_task_id, VAVLE_CLOSE_START_EVT); // 设置阀门关闭开始事件
|
||||
|
||||
// tmos_start_task(vavle_task_id, VAVLE_LOW_VBAT_ALARM_EVT, MS1_TO_SYSTEM_TIME(VALVE_LOW_VBAT_ALARM_PERIOD_MS)); // 启动低电压报警事件,延时一段时间
|
||||
|
||||
return (events ^ VAVLE_LOW_VBAT_ALARM_EVT); // 返回未处理的事件
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void BSP_VAVLE_Init(void) // 阀门初始化函数
|
||||
{
|
||||
vavle_task_id = TMOS_ProcessEventRegister(VAVLE_Task_ProcessEvent);
|
||||
|
||||
tmos_memset(&gValveData, 0, sizeof(gValveData));
|
||||
|
||||
gValveData.switch_status = kClosed; // 设置阀门状态为关闭
|
||||
gValveData.temp = -100;
|
||||
gValveData.in_pressure = 0;
|
||||
gValveData.out_pressure = 0;
|
||||
gValveData.atm_pressure = 0;
|
||||
|
||||
gValveData.type = kTyq; // 设置阀门类型
|
||||
gValveData.bat = BSP_ReadVbat(); // 读取电池电压
|
||||
|
||||
BSP_MOTOR_Init(); // 初始化电机
|
||||
|
||||
tmos_start_task(vavle_task_id, VAVLE_LOOP_DECT_EVT, MS1_TO_SYSTEM_TIME(VALVE_DECT_PERIOD_MS));
|
||||
|
||||
logInfo("BSP_Valve_Init");
|
||||
}
|
Loading…
Reference in New Issue