Files
wuchuyuan 0dd65e1552 1、喷淋器 P1/P2功能实现
2、红灯按连接态慢闪
2026-09-09 19:57:00 +08:00

69 lines
2.1 KiB
C
Raw Permalink 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 功能总装:按键动作 + DP 同步(配对/OTA 只在任务上下文落地)
* @author cyWu <1917507415@qq.com>
* @date 2026.09.09
* @version V1.0.0
******************************************************************************/
#ifndef __APP_FUNCTION_H__
#define __APP_FUNCTION_H__
#include <stdint.h>
/**
* @brief 初始化功能模块状态
* @return 无
*/
void app_function_init(void);
/**
* @brief 同步 DPDP1=喷淋作业态),每个 20ms 业务 tick 调用
* @note 上报的是**作业态**(整轮含间隔等待为 1),不是某一只脚的瞬时电平
* @return 无
*/
void app_function_poll(void);
/**
* @brief 任务上下文周期处理(usr_timer_loop 500ms
* @note 写 VM / 配对 / OTA 只准在此落地,禁止放进 20ms ISR
* @return 无
*/
void app_function_loop(void);
/**
* @brief 业务层喷淋键短按回调(key_manager 触发):空闲开一轮 / 作业中停
* @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 DP24 出厂重置(规格书第 15 章):清业务 VM + RAM 复位
* @note 保留 BLE 配对、不断开、不软复位。jbEventProcess(任务上下文)调用。
* @return 无
*/
void app_function_factory_reset(void);
#endif /* __APP_FUNCTION_H__ */