static INT32 as_select_nim(S_NODE *snode) { INT32 res = SUCCESS; UINT8 nim_id = 0; //0 or 1 if(snode->tuner1_valid == 1) { nim_id = 0; tsi_select(TSI_DMX_0, ts_route_get_nim_tsiid(nim_id)); as_info->nim = (struct nim_device *)dev_get_by_id(HLD_DEV_TYPE_NIM, nim_id); } else if(snode->tuner2_valid == 1) { nim_id = 1; tsi_select(TSI_DMX_0, ts_route_get_nim_tsiid(nim_id)); as_info->nim = (struct nim_device *)dev_get_by_id(HLD_DEV_TYPE_NIM, nim_id); } else { nim_id = 0; as_info->nim = (struct nim_device *)dev_get_by_id(HLD_DEV_TYPE_NIM, nim_id); return res; } return res; }
//for tuner to select the nim device static INT32 as_select_nim(S_NODE *snode) { INT32 res = SUCCESS; UINT8 nim_id = 0; if(2 > dev_get_device_cnt(HLD_DEV_TYPE_NIM, FRONTEND_TYPE_S)) { nim_id = 0; tsi_select(TSI_DMX_0, ts_route_get_nim_tsiid(nim_id)); as_info->nim = (struct nim_device *)dev_get_by_id(HLD_DEV_TYPE_NIM, nim_id); return res; } #ifndef SUPPORT_SELECT_SAME_SAT if(snode->tuner1_valid == 1) #else if(snode->reserve_1 == 0) #endif { nim_id = 0; tsi_select(TSI_DMX_0, ts_route_get_nim_tsiid(nim_id)); as_info->nim = (struct nim_device *)dev_get_by_id(HLD_DEV_TYPE_NIM, nim_id); } #ifndef SUPPORT_SELECT_SAME_SAT else if(snode->tuner2_valid == 1) #else else if(snode->reserve_1 == 1) #endif { nim_id = 1; tsi_select(TSI_DMX_0, ts_route_get_nim_tsiid(nim_id)); as_info->nim = (struct nim_device *)dev_get_by_id(HLD_DEV_TYPE_NIM, nim_id); } else { res = ERR_FAILUE; } return res; }
void win_otaset_turn_frntend(void) { UINT8 back_saved; S_NODE s_node; T_NODE t_node; win_otaset_get_FreqSymbPid_display(); cur_tuner_idx = OTA_TUNER_IDX; #ifdef _BUILD_OTA_E_ MEMCPY(&s_node, &m_ota_cfg.s_node, sizeof(s_node)); #else get_tuner_sat(OTA_TUNER_IDX, ota_satpos, &s_node); MEMCPY(&m_ota_cfg.s_node, &s_node, sizeof(s_node)); t_node.frq = ota_freq; t_node.sym = ota_symb; t_node.pol = ota_pol; MEMCPY(&m_ota_cfg.t_node, &t_node, sizeof(t_node)); m_ota_cfg.pid = ota_pid; #endif #ifndef NEW_DEMO_FRAME struct xpond_antenna_info xai; sat2antenna_ext(&s_node, &xai.antenna,OTA_TUNER_IDX); xai.xpond.frq = ota_freq; xai.xpond.sym = ota_symb; xai.xpond.pol = ota_pol; UIChChgSetAntennaXpond(&xai); #else struct ft_antenna antenna; union ft_xpond xponder; struct nim_device *nim = NULL; cur_tuner_idx = s_node.tuner1_valid ? 0 : 1; MEMSET(&antenna, 0, sizeof(struct ft_antenna)); MEMSET(&xponder, 0, sizeof(union ft_xpond)); #if (SYS_PROJECT_FE == PROJECT_FE_DVBS || SYS_PROJECT_FE == PROJECT_FE_DVBS2) sat2antenna(&s_node, &antenna); #endif antenna.antenna_enable = 1; xponder.s_info.type = FRONTEND_TYPE_S; xponder.s_info.frq = ota_freq; xponder.s_info.sym = ota_symb; xponder.s_info.pol = ota_pol; nim = (struct nim_device *)dev_get_by_id(HLD_DEV_TYPE_NIM, (s_node.tuner1_valid ? 0 : (s_node.tuner2_valid ? 1 : 0))); frontend_tuning(nim, &antenna, &xponder, 1); if(0 == cur_tuner_idx) //TUNER1 <--> TSI_TS_A <--> DMX0 { tsi_dmx_src_select(TSI_DMX_0,TSI_TS_A); tsi_select(TSI_TS_A,ts_route_get_nim_tsiid(0)); } else//TUNER2 <--> TSI_TS_B <--> DMX0 { tsi_dmx_src_select(TSI_DMX_0,TSI_TS_B); tsi_select(TSI_TS_B, ts_route_get_nim_tsiid(1)); } #endif wincom_dish_move_popup_open(ota_presat_id,s_node.sat_id,cur_tuner_idx,&back_saved); ota_presat_id = s_node.sat_id;