①三个重要的源文件:rec_op_def.h,receiver.c,atomic2_tuner.c。
②重要的函数:
rec_task-----死循环线程;at2_tuner_power_up_handling------初始化流程;
rec_op_handling-----操作处理函数;rec_search_handling-------搜索处理函数。
③重要的结构体:
//用于操作处理的结构体
typedef enum
{
REC_OP_STATE_DONE, //操作完成
REC_OP_STATE_FAIL, //操作失败
REC_OP_STATE_CANCEL, //操作退出
REC_OP_STATE_SKIP, //操作跳过
REC_OP_STATE_WORKING, //操作进行中
REC_OP_STATE_MAX,
}REC_OP_STATE_TYPES;
//用于搜索处理的结构体
typedef enum
{
// 5
REC_SCH_MUTE_START = REC_OP_STATE_MAX,
REC_SCH_MUTE, //设置静音
REC_SCH_MUTE_END,
REC_SCH_SEL_BAND_START,
REC_SCH_SEL_BAND, //IO_UP2PS_SYNC_ClrVal tuner_set_band_frequency//设置tuner的工作频率和波段
// 10
REC_SCH_SEL_BAND_END,
REC_SCH_TUNE_START,
REC_SCH_TUNE, //与REC_SCH_SEL_BAND有点像
REC_SCH_TUNE_END,
REC_SCH_WAIT_TUNE_STABLE_START,
// 15
REC_SCH_WAIT_TUNE_STABLE, //tuner_stop_search
REC_SCH_WAIT_TUNE_STABLE_END,
REC_SCH_UNMUTE_START,
REC_SCH_UNMUTE, //
REC_SCH_UNMUTE_END,
// 20
REC_SCH_FREQ_FIX_START,
REC_SCH_FREQ_FIX, //
REC_SCH_FREQ_FIX_END,
REC_SCH_NEXT_FREQ_START,
REC_SCH_NEXT_FREQ,
// 25
REC_SCH_NEXT_FREQ_END,
REC_SCH_CHECK_QUALITY_START,
REC_SCH_CHECK_QUALITY,
REC_SCH_CHECK_QUALITY_END,
REC_SCH_SCAN_PLAY_START,
// 30
REC_SCH_SCAN_PLAY, //扫描
REC_SCH_SCAN_PLAY_END,
REC_SCH_TARGET_SKIP_DELAY_START,
REC_SCH_TARGET_SKIP_DELAY,
REC_SCH_TARGET_SKIP_DELAY_END,
}REC_SEARCH_STATE;
//tuner初始化相关结构体:
typedef enum
{
AT2_TUNER_RESET_STEP_START = REC_OP_STATE_MAX,
AT2_TUNER_RESET_STEP_WAIT,
AT2_TUNER_POWER_ENABLE,
AT2_TUNER_POWER_SETTLING,
AT2_TUNER_POWER_UP_STEP_INIT,
AT2_TUNER_POWER_UP_STEP_BOOT,
AT2_TUNER_POWER_UP_SEND_LARGE_PATCH,
AT2_TUNER_POWER_UP_STEP_BOOT_2,
AT2_TUNER_POWER_UP_STEP_IDLE,
AT2_TUNER_POWER_UP_STEP_ACTIVE,
AT2_TUNER_POWER_UP_STEP_READY,
AT2_TUNER_POWER_UP_STEP_DLY_FOR_DTS
}AT2_TUNER_POWER_UP_STEP_TYPES;
④几个重要的宏:
/************************************************************************************************************************/
rec_brk_logic[REC_OP_INDIRECT_MAX][REC_OP_BREAKEABLE_MAX]
#define BEGIN_REC_OP const U8 rec_brk_logic[REC_OP_INDIRECT_MAX][REC_OP_BREAKEABLE_MAX] = {
#define REC_OP(e,o,h,b,d,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12) b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12,
#define END_REC_OP };
/************************************************************************************************************************/
rec_brk_funcs:
#define BEGIN_REC_OP const REC_OP_BRK_FUNC rec_brk_funcs[REC_OP_INDIRECT_MAX] = {
#define REC_OP(e,o,h,b,d,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12) b,
#define END_REC_OP };
/************************************************************************************************************************/
rec_op_demute:
#define BEGIN_REC_OP const BOOL rec_op_demute[REC_OP_MAX] = {
#define REC_OP(e,o,h,b,d,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12) d,
#define REC_OP_DIRECT(e,o,d) d,
#define END_REC_OP };
/************************************************************************************************************************/
rec_op_exe_funcs
#define BEGIN_REC_OP const REC_OP_EXE_FUNC rec_op_exe_funcs[REC_OP_INDIRECT_MAX] = {
#define REC_OP(e,o,h,b,d,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12) h,
#define END_REC_OP };
/************************************************************************************************************************/
rec_op_funcs
#define BEGIN_REC_OP const REC_MBX_OP_FUNC rec_op_funcs[REC_OP_MAX] = {
#define REC_OP(e,o,h,b,d,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12) o,
#define REC_OP_DIRECT(e,o,d) o,
#define END_REC_OP };
/************************************************************************************************************************/
⑥重要的状态切换处理有关宏:
e o h b d b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12
// DEMUTE POF PON DTV RCV PLAY ASH AST TSCH TSP SCNS SFRQ MS SBND
REC_OP(REC_POWER_OFF, rec_power_off, rec_power_off_exe, rec_dummy_brk, FALSE, N__, BE_, BE_, BE_, BE_, BE_, BE_, BE_, BE_, BE_, BE_, BE_, BE_)//POWEROFF