Ejemplo n.º 1
0
/*
 * 1. 将所有的 tcb 加入 tcb_free_head
 * 2. 初始化 tcb_head
 */
void tcb_head_init(void)
{
	int i = 0;

	tcb_free_head = &free_head;
	tcb_rdy_head = &rdy_head;
	tcb_dly_head = &dly_head;


	// tcb_tbl[i] = 0;
	mem_clr(&tcb_tbl[0], sizeof(tcb_tbl));

	// tcb_prio_tbl[i] == NULL;
	mem_clr(&tcb_prio_tbl[0], sizeof(tcb_prio_tbl));

	// n = TASK_NUM - 1
	// 确保 空闲任务 不在 tcb_free_head
	for (i = 0; i < TASK_NUM; ++i)
	{
		list_add(&tcb_tbl[i].list, tcb_free_head);
	}

	event_free_head = &event_tbl[0];
	for (i = 0; i < MAX_EVENTS - 1; ++i)
	{
		event_tbl[i].event_ptr = &event_tbl[i+1];
	}
	event_tbl[MAX_EVENTS - 1].event_ptr = NULL;

}
Ejemplo n.º 2
0
    void GLTexture2DRenderView::clearColor(const Color& clr) {
        if(mFBO != 0) {
            this->doClear(GL_COLOR_BUFFER_BIT, clr, 0, 0);
        } else {
            glBindTexture(GL_TEXTURE_2D, mTex);

            std::vector<Color> mem_clr(mWidth * mHeight, clr);
            CHECK_GL_CALL(glTexSubImage2D(GL_TEXTURE_2D, mLevel, 0, 0, mWidth, mHeight, GL_RGBA, GL_FLOAT, mem_clr.data()));
        }
    }
Ejemplo n.º 3
0
static void rdy_list_init(void)
{
	rdy_grp = 0;
	mem_clr(rdy_tbl, sizeof(rdy_tbl));

	cur_prio = 0;
	high_rdy_prio = 0;

	tcb_high_rdy = NULL;
	cur_tcb = NULL;
}
Ejemplo n.º 4
0
	void OGLESTexture2DRenderView::ClearColor(Color const & clr)
	{
		if (fbo_ != 0)
		{
			this->DoClear(GL_COLOR_BUFFER_BIT, clr, 0, 0);
		}
		else
		{
			glBindTexture(texture_2d_.GLType(), tex_);

			std::vector<Color> mem_clr(width_ * height_, clr);
			glTexSubImage2D(texture_2d_.GLType(), level_, 0, 0, width_, height_, GL_RGBA, GL_FLOAT, &mem_clr[0]);
		}
	}
Ejemplo n.º 5
0
	void OGLESTextureCubeRenderView::ClearColor(Color const & clr)
	{
		if (fbo_ != 0)
		{
			this->DoClear(GL_COLOR_BUFFER_BIT, clr, 0, 0);
		}
		else
		{
			glBindTexture(GL_TEXTURE_CUBE_MAP, tex_);

			std::vector<Color> mem_clr(width_ * height_, clr);
			glTexSubImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + face_ - Texture::CF_Positive_X,
				level_, 0, 0, width_, height_, GL_RGBA, GL_FLOAT, &mem_clr[0]);
		}
	}
/*******************************************************************************
* Function Name  : mgnt_diag()
* Description    : 
* Input          : None
* Output         : None
* Return         : pt_return_buffer首字节表示返回长度
				 
*******************************************************************************/
STATUS mgnt_diag(u16 pipe_id, DLL_SEND_HANDLE pds, u8 * pt_return_buffer, AUTOHEAL_LEVEL autoheal_level)
{
	u8 i;

	STATUS status;

	for(i = 0;i<CFG_MAX_DIAG_TRY;i++)
	{
		mem_clr(pt_return_buffer,1,8);		//最少返回8字节,靠返回的8字节判断通信情况
		status = psr_mgnt_cmd(EXP_MGNT_DIAG, pipe_id, pds, pt_return_buffer, autoheal_level);

		if(status)
		{
			break;
		}
	}

	return status;
}
Ejemplo n.º 7
0
/*******************************************************************************
* Function Name  : init_ptp
* Description    : 设置PTP缺省的通信方式
* Input          : 
* Output         : 
* Return         : 
*******************************************************************************/
void init_ptp(void)
{
	_ptp_config_obj.comm_mode = CHNL_CH3;
	mem_clr(_ptp_rcv_obj, sizeof(PTP_STACK_RCV_STRUCT), CFG_PHASE_CNT);
}