优化程序架构

This commit is contained in:
2026-08-25 14:59:39 +08:00
parent d5ec6ecde0
commit 5252471aca
25 changed files with 2964 additions and 1608 deletions
+25
View File
@@ -0,0 +1,25 @@
/******************************************************************************
* @file app_boot.h
* @brief 深睡唤醒 / 上电按键判定:3s 开机,5s 开机并配对,不足 3s 松手再睡
* @author cyWu <1917507415@qq.com>
* @date 2026.08.25
* @version V1.0.0
* @history
* - V1.0.0, 2026.08.25, cyWu, 从 usr_jb_main 拆出
*
* @note 必须在 BLE 协议栈起来、1ms 定时器启动之前调用。杰理 jiffies 此时
* 往往 10ms 才跳一次,所以内部一律用 timer_get_ms 直接量时间,
* 不能借用按键库的 1ms 状态机(否则长按时长会被严重低估)。
******************************************************************************/
#ifndef __APP_BOOT_H__
#define __APP_BOOT_H__
/**
* @brief 等待并判定开机按键:不足 3s 松手、或全程未按键,直接原地深睡(不返回);
* 满 3s 视为正常开机;满 5s 视为开机并进入配对(内部会调用 app_pair_start
* @return 无(深睡分支通过 while(1) 喂狗不返回;其余情况正常返回)
*/
void app_boot_wait_key(void);
#endif /* __APP_BOOT_H__ */