
1. add new shell command: reg_ape to print the timer task info; 2. update the function of osp_timer_sync; 3. add new testcase of case1 to test the timer(t_offset < 10) 4. Test: 4.1 spu_case0_arm_case0: Pass; 4.2 spu_case1_arm_case20: Pass; 4.3 spu_case14_arm_case20:Pass; 4.4 spu_case20_arm_case20:Pass; 4.5 spu_case24_arm_case24:Pass; 4.6 spu_case34_arm_case5: Pass; 4.7 spu_case44_arm_case5: Pass;
49 lines
1.8 KiB
C
49 lines
1.8 KiB
C
#ifndef __OSP_TIMER_H__
|
||
#define __OSP_TIMER_H__
|
||
|
||
#include "osp_type_def.h"
|
||
#include "stc_timer.h"
|
||
|
||
#define OSP_TIMER_TASK_MAX (20) //(64) /* IM优化,单核最多定时点任务个数:20个 */
|
||
#define OSP_TIMER_COUNTS (OSP_TIMER_TASK_MAX -1)
|
||
#define OSP_TMR_POINT_MAX (TDD_TMR_POINT_MAX)
|
||
|
||
/* 静态定时点注册信息结构体 */
|
||
typedef struct osp_timer_cfg_inf_st{
|
||
uint32_t apeid_bitmap;
|
||
uint32_t task_id;
|
||
char* task_name;
|
||
uint32_t slot_bitmap;
|
||
uint32_t t_offset;
|
||
}osp_timer_cfg_inf;
|
||
|
||
typedef struct osp_offset_timer_st{
|
||
char cnt;
|
||
}osp_offset_timer;
|
||
|
||
/* 定时点与定时任务描述结构体 */
|
||
typedef struct osp_timer_desc_st{
|
||
uint32_t task_id;
|
||
uint32_t slot_bitmap;
|
||
uint32_t t_offset;
|
||
}osp_timer_desc;
|
||
|
||
/* 定时点偏移与任务ID结构体 */
|
||
typedef struct osp_id_timer_st{
|
||
short t_offset;
|
||
char task_id;
|
||
}osp_id_timer_t;
|
||
|
||
extern int g_osp_timer_desc_idx; /* OSP侧任务模块注册定时点任务时,需要记录 */
|
||
extern osp_timer_desc g_osp_timer_desc[OSP_TIMER_TASK_MAX]; /* OSP侧任务模块注册定时点任务时,需要记录 */
|
||
|
||
extern void osp_timer_init(void); /* 初始化 */
|
||
extern void osp_timer_sync(int scsId); /* 定时点任务设置完毕,启动 */
|
||
extern void osp_timer_unsync(int scsId); /* 删除定时点任务配置信息和设置,删除任务 */
|
||
extern void osp_timer_unsync_notask(int scs_id); /* 只清空定时点配置信息和设备,未删除任务 */
|
||
extern void osp_timer_call_task(); /* 顺序触发定时点任务 */
|
||
extern void osp_timer_call_task_spe(uint8_t u8slot, uint8_t u8taskidx); /* 指定触发某定时点任务 */
|
||
extern void osp_register_task_group_show(void);
|
||
#endif /* __OSP_TIMER_H__ */
|
||
|