P0功能已实现,按键、LED、过零检测、配网、OTA都已正常实现
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
/******************************************************************************
|
||||
* @file app_th_scan.c
|
||||
* @brief CBR1 断连温湿度扫描骨架(P0:BOARD_TH_SCAN_ENABLE=0)
|
||||
* @author cyWu <1917507415@qq.com>
|
||||
* @date 2026.09.04
|
||||
* @version V1.0.0,P2 填充实现(规格书第 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
|
||||
}
|
||||
Reference in New Issue
Block a user