Files
JBao_Heat_Pad_FW/apps/usr_app/app_th_scan.c
T

53 lines
1.2 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/******************************************************************************
* @file app_th_scan.c
* @brief CBR1 断连温湿度扫描骨架(P0BOARD_TH_SCAN_ENABLE=0
* @author cyWu <1917507415@qq.com>
* @date 2026.09.04
* @version V1.0.0P2 填充实现(规格书第 8 章)
******************************************************************************/
#include "system/includes.h"
#include "app_th_scan.h"
#include "board_pin.h"
#define LOG_TAG_CONST APP
#define LOG_TAG "[THSCAN]"
#define LOG_INFO_ENABLE
#include "debug.h"
static void th_scan_disabled_once(void)
{
static uint8_t s_logged;
if (!s_logged) {
s_logged = 1;
log_info("app_th_scan disabled (P2)\n");
}
}
/**
* @brief 初始化扫描模块
* @return 无
*/
void app_th_scan_init(void)
{
#if BOARD_TH_SCAN_ENABLE
/* P2: 无状态(500ms 时隙由 tick 驱动) */
#else
th_scan_disabled_once();
#endif
}
/**
* @brief 500ms 任务上下文:断连已配对时广播/扫描交替
* @return 无
*/
void app_th_scan_tick(void)
{
#if BOARD_TH_SCAN_ENABLE
/* P2: 已连接/配对/OTA → 退交替;断连已配对 → 偶见宝重连广播/奇扫描 */
#else
th_scan_disabled_once();
#endif
}