Files
JBao_Temp_Humi_Fan_FW/apps/usr_app/app_function.h
T

74 lines
2.4 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_function.h
* @brief CBR3 功能总装:按键动作(短按切档 / 长按 5s 配对 / 长按 12s OTA+ DP 同步
* @author cyWu <1917507415@qq.com>
* @date 2026.09.02
* @version V3.0.0(规格书 V3.0.0):app_cond → app_linkage/app_runrec
* 出厂重置改 DP27、清联动 20B 与 31 天运行记录
*
* @note 本模块只做"按键 → 动作"和"状态 → DP",不写业务算法。
* 档位/模式/联动/运行记录的执行在各自 app_* 模块(规格书 0 章第 2 条)。
******************************************************************************/
#ifndef __APP_FUNCTION_H__
#define __APP_FUNCTION_H__
#include <stdint.h>
/**
* @brief 初始化功能模块状态
* @return 无
*/
void app_function_init(void);
/**
* @brief 同步 DPfan_gear、mode、fault_code),每个业务 tick 调用
* @note DP0 power 不在这里同步:恒为开机态,写死在 app_function_init
* @return 无
*/
void app_function_poll(void);
/**
* @brief 任务上下文周期处理(由 usr_timer_loop 500ms 调用)
* @note ⚠ VM 落盘(syscfg_write)与配对/OTA 落地只允许在这里做:usr_timer_loop
* 跑在 BLE 线程(任务上下文,栈充足);usr_timer_tick 是硬件定时器
* 中断上下文,做这些会栈溢出复位。
* @return 无
*/
void app_function_loop(void);
/**
* @brief 业务层短按回调(key_manager 触发):档位 1→2→3→0→1…
* @return 无
*/
void usr_on_key_short(void);
/**
* @brief 业务层"按住满 5s"回调(key_manager 触发,20ms 中断上下文)
* @note 只切提示灯,不清绑定
* @return 无
*/
void usr_on_key_pair_hint(void);
/**
* @brief 业务层"按满 5s 后松手"回调(key_manager 触发,20ms 中断上下文)
* @note 只置标志:清绑定要写 VM,由 app_function_loop 在任务上下文执行
* @return 无
*/
void usr_on_key_pair_start(void);
/**
* @brief 业务层"按住满 12s"回调(key_manager 触发,20ms 中断上下文)
* @note 只置标志:usr_app_ota_init 由 app_function_loop 在任务上下文执行
* @return 无
*/
void usr_on_key_ota_start(void);
/**
* @brief 出厂重置:清业务 VM 与 RAM,保留 BLE 配对(规格书 14 章)
* @return 无
*/
void app_function_factory_reset(void);
#endif /* __APP_FUNCTION_H__ */