Files
JBao_Heat_Pad_FW/apps/usr_app/app_timer_task.c
T

85 lines
1.7 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_timer_task.c
* @brief CBR1 定时引擎骨架(P0BOARD_TIMER_ENABLE=0
* @author cyWu <1917507415@qq.com>
* @date 2026.09.04
* @version V1.0.0P2 填充实现(规格书第 11 章)
******************************************************************************/
#include "system/includes.h"
#include "app_timer_task.h"
#include "board_pin.h"
#define LOG_TAG_CONST APP
#define LOG_TAG "[TIMER]"
#define LOG_INFO_ENABLE
#include "debug.h"
static void timer_disabled_once(void)
{
static uint8_t s_logged;
if (!s_logged) {
s_logged = 1;
log_info("app_timer_task disabled (P2)\n");
}
}
/**
* @brief 初始化定时引擎
* @return 无
*/
void app_timer_init(void)
{
#if BOARD_TIMER_ENABLE
/* P2: RTC 门闩 + 状态复位 */
#else
timer_disabled_once();
#endif
}
/**
* @brief 500ms 任务上下文跑定时引擎
* @param dt 距上次调用的毫秒数
* @return 无
*/
void app_timer_run(uint16_t dt)
{
#if BOARD_TIMER_ENABLE
(void)dt;
/* P2: 窗判断 → 仲裁 timer_take/release → 请求开/关 */
#else
(void)dt;
#endif
}
/**
* @brief APP 写 DP9 定时总开关
* @param en 0=关 1=开
* @return 无
*/
void app_timer_set_en(uint8_t en)
{
#if BOARD_TIMER_ENABLE
(void)en;
/* P2: time_en=0 → 所有窗立刻结束(关加热)再补判联动 */
#else
(void)en;
#endif
}
/**
* @brief APP 写 DP10~16 定时配置
* @param idx 1~7
* @return 无
*/
void app_timer_set_config(uint8_t idx)
{
#if BOARD_TIMER_ENABLE
(void)idx;
/* P2: 配置入 RAM + mark_dirty */
#else
(void)idx;
#endif
}