Ejemplo n.º 1
0
Archivo: ad.cpp Proyecto: djmmoss/SAD
void ad(stream<axiInOut> &inData, stream<axiInOut> &outData) {
    #pragma VHLS dataflow interval=1
	#pragma HLS pipeline II=1 enable_flush

	#pragma HLS INTERFACE port=return ap_ctrl_none
    #pragma HLS INTERFACE port=inData axis
    #pragma HLS INTERFACE port=outData axis

	static stream<axiInIndex> inIndex;
	static stream<axiIndex> indices;
	static stream<axiRawValues> rawValues;
	static stream<axiValues> values;

	#pragma HLS STREAM variable=inIndex depth=4
	#pragma HLS STREAM variable=indices depth=4
	#pragma HLS STREAM variable=rawValues depth=4
	#pragma HLS STREAM variable=values depth=4

	ad_discretise(inData, inIndex);
	ad_window(inIndex, indices);
	ad_grid_update(indices, rawValues);
	ad_grid(rawValues, values);
	ad_update(values, outData);
}
Ejemplo n.º 2
0
void change_channel(INT32 shift)
{
	UINT16 cur_channel, max_channel;
	P_NODE p_node;
	UINT32 n;
	SYSTEM_DATA *sys_data;

	sys_data = sys_data_get();

	//max_channel = get_node_num(TYPE_PROG_NODE, NULL);
	max_channel = get_prog_num(VIEW_ALL | sys_data->cur_chan_mode, 0);
	if (max_channel == 0)
	{
#ifdef MULTI_CAS
#if(CAS_TYPE==CAS_CONAX)
		if(get_mmi_msg_cnt()>0)
		{
			ap_send_msg(CTRL_MSG_SUBTYPE_STATUS_MCAS, 0, FALSE);
			MMI_PRINTF("CTRL_MSG_SUBTYPE_STATUS_MCAS: change ch only one; code:%d\n",0);
			set_mmi_showed(10);
		}
#endif
#endif    	
		return ;
	}
	cur_channel = sys_data_get_cur_group_cur_mode_channel();

	n = 0;
	do
	{
		cur_channel = (cur_channel + shift + max_channel) % max_channel;
		get_prog_at(cur_channel, &p_node);
		n++;
	}
	while ( ( p_node.skip_flag
	          || ( sys_data->chan_sw == CHAN_SWITCH_FREE && p_node.ca_mode )
	          || ( sys_data->chan_sw == CHAN_SWITCH_SCRAMBLED && !p_node.ca_mode ) )
	        && n != max_channel );

	if ( p_node.skip_flag || ( sys_data->chan_sw == CHAN_SWITCH_FREE && p_node.ca_mode )
	        || ( sys_data->chan_sw == CHAN_SWITCH_SCRAMBLED && !p_node.ca_mode ) )
	{
#ifdef MULTI_CAS
#if(CAS_TYPE==CAS_CONAX)
		if(get_mmi_msg_cnt()>0)
		{
			ap_send_msg(CTRL_MSG_SUBTYPE_STATUS_MCAS, 0, FALSE);
			MMI_PRINTF("CTRL_MSG_SUBTYPE_STATUS_MCAS: change ch invalid; code:%d\n",0);
			set_mmi_showed(10);
		}
#endif
#endif        
		return ;
	}

#ifdef MULTI_CAS
#if(CAS_TYPE==CAS_CONAX)
	/*clean msg*/
	clean_mmi_msg(1, TRUE);
	clean_mmi_msg(3, TRUE);
	clean_mmi_msg(4, TRUE);
	clean_mmi_msg(6, TRUE);
	if(get_mmi_showed()==1||get_mmi_showed()==6)
		win_mmipopup_close();
	if(get_mmi_showed()!=5)
		set_mmi_showed(10);
#endif
#endif

	/*  If first time show the osd and play channel,
	to avoid display incorrect channel when meet skip channel.
	 */
	if (show_and_playchannel)
	{
		sys_data_set_cur_group_channel(cur_channel);
		win_progname_redraw(TRUE);
	}

	api_play_channel(cur_channel, TRUE, TRUE, FALSE);

    /////////ad update//////////////
#ifdef ALI_AD_DEMO_ON
    ad_update(AD_CHANNEL_BAR);
#endif
    ///////////////////////////////
#ifdef AD_SANZHOU
	szxc_ad_hide_txt();
	szxc_ad_show_txt(p_node.prog_number);
	szxc_ad_hide_pic(AD_BANNER);
	szxc_ad_show_banner(p_node.prog_number,banner_pic_rt);
#endif
}