P0功能已实现,按键、LED、过零检测、配网、OTA都已正常实现

This commit is contained in:
2026-09-04 18:49:07 +08:00
parent 2fb61a6458
commit 0de88083ba
47 changed files with 5184 additions and 26 deletions
+52
View File
@@ -0,0 +1,52 @@
/******************************************************************************
* @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
}