编码转换: GBK -> UTF-8,所有.c/.h源文件中文注释统一UTF-8编码
This commit is contained in:
+20
-20
@@ -3,7 +3,7 @@
|
||||
* Author : WCH
|
||||
* Version : V1.2
|
||||
* Date : 2022/01/18
|
||||
* Description : 硬件任务处理函数及BLE和硬件初始化
|
||||
* Description : 硬件任务处理函数及BLE和硬件初始化
|
||||
*********************************************************************************
|
||||
* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
|
||||
* Attention: This software (modified or not) and binary are used for
|
||||
@@ -11,7 +11,7 @@
|
||||
*******************************************************************************/
|
||||
|
||||
/******************************************************************************/
|
||||
/* 头文件包含 */
|
||||
/* 头文件包含 */
|
||||
#include "HAL.h"
|
||||
|
||||
tmosTaskID halTaskID;
|
||||
@@ -19,7 +19,7 @@ uint32_t g_LLE_IRQLibHandlerLocation;
|
||||
/*******************************************************************************
|
||||
* @fn Lib_Calibration_LSI
|
||||
*
|
||||
* @brief 内部32k校准
|
||||
* @brief 内部32k校准
|
||||
*
|
||||
* @param None.
|
||||
*
|
||||
@@ -96,7 +96,7 @@ uint32_t Lib_Write_Flash(uint32_t addr, uint32_t num, uint32_t *pBuf)
|
||||
/*******************************************************************************
|
||||
* @fn CH59x_BLEInit
|
||||
*
|
||||
* @brief BLE 库初始化
|
||||
* @brief BLE 库初始化
|
||||
*
|
||||
* @param None.
|
||||
*
|
||||
@@ -112,7 +112,7 @@ void CH59x_BLEInit(void)
|
||||
// while(1);
|
||||
}
|
||||
|
||||
SysTick_Config(SysTick_LOAD_RELOAD_Msk);// 配置SysTick并打开中断
|
||||
SysTick_Config(SysTick_LOAD_RELOAD_Msk);// 配置SysTick并打开中断
|
||||
PFIC_DisableIRQ(SysTick_IRQn);
|
||||
|
||||
g_LLE_IRQLibHandlerLocation = (uint32_t)LLE_IRQLibHandler;
|
||||
@@ -139,13 +139,13 @@ void CH59x_BLEInit(void)
|
||||
cfg.ConnectNumber = (PERIPHERAL_MAX_CONNECTION & 3) | (CENTRAL_MAX_CONNECTION << 2);
|
||||
cfg.srandCB = SYS_GetSysTickCnt;
|
||||
#if(defined TEM_SAMPLE) && (TEM_SAMPLE == TRUE)
|
||||
cfg.tsCB = HAL_GetInterTempValue; // 根据温度变化校准RF和内部RC( 大于7摄氏度 )
|
||||
cfg.tsCB = HAL_GetInterTempValue; // 根据温度变化校准RF和内部RC( 大于7摄氏度 )
|
||||
#if(CLK_OSC32K)
|
||||
cfg.rcCB = Lib_Calibration_LSI; // 内部32K时钟校准
|
||||
cfg.rcCB = Lib_Calibration_LSI; // 内部32K时钟校准
|
||||
#endif
|
||||
#endif
|
||||
#if(defined(HAL_SLEEP)) && (HAL_SLEEP == TRUE)
|
||||
cfg.idleCB = CH59x_LowPower; // 启用睡眠
|
||||
cfg.idleCB = CH59x_LowPower; // 启用睡眠
|
||||
#endif
|
||||
#if(defined(BLE_MAC)) && (BLE_MAC == TRUE)
|
||||
for(i = 0; i < 6; i++)
|
||||
@@ -158,7 +158,7 @@ void CH59x_BLEInit(void)
|
||||
GetMACAddress(MacAddr);
|
||||
for(i = 0; i < 6; i++)
|
||||
{
|
||||
cfg.MacAddr[i] = MacAddr[i]; // 使用芯片mac地址
|
||||
cfg.MacAddr[i] = MacAddr[i]; // 使用芯片mac地址
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -177,7 +177,7 @@ void CH59x_BLEInit(void)
|
||||
/*******************************************************************************
|
||||
* @fn HAL_ProcessEvent
|
||||
*
|
||||
* @brief 硬件层事务处理
|
||||
* @brief 硬件层事务处理
|
||||
*
|
||||
* @param task_id - The TMOS assigned task ID.
|
||||
* @param events - events to process. This is a bit map and can
|
||||
@@ -190,7 +190,7 @@ tmosEvents HAL_ProcessEvent(tmosTaskID task_id, tmosEvents events)
|
||||
uint8_t *msgPtr;
|
||||
|
||||
if(events & SYS_EVENT_MSG)
|
||||
{ // 处理HAL层消息,调用tmos_msg_receive读取消息,处理完成后删除消息。
|
||||
{ // 处理HAL层消息,调用tmos_msg_receive读取消息,处理完成后删除消息。
|
||||
msgPtr = tmos_msg_receive(task_id);
|
||||
if(msgPtr)
|
||||
{
|
||||
@@ -217,14 +217,14 @@ tmosEvents HAL_ProcessEvent(tmosTaskID task_id, tmosEvents events)
|
||||
if(events & HAL_REG_INIT_EVENT)
|
||||
{
|
||||
uint8_t x32Kpw;
|
||||
#if(defined BLE_CALIBRATION_ENABLE) && (BLE_CALIBRATION_ENABLE == TRUE) // 校准任务,单次校准耗时小于10ms
|
||||
BLE_RegInit(); // 校准RF
|
||||
#if(defined BLE_CALIBRATION_ENABLE) && (BLE_CALIBRATION_ENABLE == TRUE) // 校准任务,单次校准耗时小于10ms
|
||||
BLE_RegInit(); // 校准RF
|
||||
#if(CLK_OSC32K)
|
||||
Lib_Calibration_LSI(); // 校准内部RC
|
||||
Lib_Calibration_LSI(); // 校准内部RC
|
||||
#else
|
||||
x32Kpw = (R8_XT32K_TUNE & 0xfc) | 0x01;
|
||||
sys_safe_access_enable();
|
||||
R8_XT32K_TUNE = x32Kpw; // LSE驱动电流降低到额定电流
|
||||
R8_XT32K_TUNE = x32Kpw; // LSE驱动电流降低到额定电流
|
||||
sys_safe_access_disable();
|
||||
#endif
|
||||
tmos_start_task(halTaskID, HAL_REG_INIT_EVENT, MS1_TO_SYSTEM_TIME(BLE_CALIBRATION_PERIOD));
|
||||
@@ -243,7 +243,7 @@ tmosEvents HAL_ProcessEvent(tmosTaskID task_id, tmosEvents events)
|
||||
/*******************************************************************************
|
||||
* @fn HAL_Init
|
||||
*
|
||||
* @brief 硬件初始化
|
||||
* @brief 硬件初始化
|
||||
*
|
||||
* @param None.
|
||||
*
|
||||
@@ -263,17 +263,17 @@ void HAL_Init()
|
||||
HAL_KeyInit();
|
||||
#endif
|
||||
#if(defined BLE_CALIBRATION_ENABLE) && (BLE_CALIBRATION_ENABLE == TRUE)
|
||||
tmos_start_task(halTaskID, HAL_REG_INIT_EVENT, 800); // 添加校准任务,500ms启动,单次校准耗时小于10ms
|
||||
tmos_start_task(halTaskID, HAL_REG_INIT_EVENT, 800); // 添加校准任务,500ms启动,单次校准耗时小于10ms
|
||||
#endif
|
||||
// tmos_start_task( halTaskID, HAL_TEST_EVENT, 1600 ); // 添加一个测试任务
|
||||
// tmos_start_task( halTaskID, HAL_TEST_EVENT, 1600 ); // 添加一个测试任务
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* @fn HAL_GetInterTempValue
|
||||
*
|
||||
* @brief 获取内部温感采样值,如果使用了ADC中断采样,需在此函数中暂时屏蔽中断.
|
||||
* @brief 获取内部温感采样值,如果使用了ADC中断采样,需在此函数中暂时屏蔽中断.
|
||||
*
|
||||
* @return 内部温感采样值.
|
||||
* @return 内部温感采样值.
|
||||
*/
|
||||
uint16_t HAL_GetInterTempValue(void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user