⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 compo_init.c

📁 COMPO source code for reference
💻 C
📖 第 1 页 / 共 2 页
字号:
    MemoryTrace_Init( Device_p->CPUPartition_p );#ifdef COMPO_ENABLE_BASIC_TRACE    MemoryTrace_Write_Config("\r\nCfg:Stt:VSYNCH:State:SetView:Visible");    MemoryTrace_Write_Config("\r\nCfg:Stt:GEN:State:SetView:Visible");    MemoryTrace_Write_Config("\r\nCfg:Stt:COMP:State:SetView:Visible");    MemoryTrace_Write_Config("\r\nCfg:Val:NbR:SetView:Visible");    MemoryTrace_Write_Config("\r\nCfg:Val:GenTime:SetView:Visible");    MemoryTrace_Write_Config("\r\nCfg:Val:CompTime:SetView:Visible");    MemoryTrace_Write_Config("\r\nCfg:Val:Nodes:SetView:Visible");#endif /* COMPO_ENABLE_BASIC_TRACE */#ifdef COMPO_ENABLE_SETTINGS_TRACE    MemoryTrace_Write_Config("\r\nCfg:Stt:Setting:State:SetView:Visible");#endif /* COMPO_ENABLE_SETTINGS_TRACE */#endif /* COMPO_USE_MEMORY_TRACE */    return Err;}/*--------------------------------------------------------------------------------Term----------------------------------------------------------------------------------*/ST_ErrorCode_t STCOMPO_Term(STCOMPO_Handle_t CompoHandle){    stcompo_Device_t*       Device_p = (stcompo_Device_t*)CompoHandle;    ST_ErrorCode_t          Err;    stcompo_ScreenRect_t*   Next_p;    /* Data structure Protection */#ifdef ST_OS21    semaphore_wait (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20    semaphore_wait (&Device_p->AccessControlSemaphore);#endif    Err = HALCOMPO_Term(Device_p->HalCompoHandle);#ifdef TEST_PARAMETER    if ( Err != ST_NO_ERROR )    {#ifdef ST_OS21        semaphore_signal (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20        semaphore_signal (&Device_p->AccessControlSemaphore);#endif        return(Err);    }#endif#ifdef COMPO_USE_EVENT_NOTIFY    Err = stcompo_EvtUnRegister(Device_p);    if ( Err != ST_NO_ERROR )    {        return(Err);    }#endif    /* Free additional overlay pointer array needed for complexity bigger than default one */    for (Next_p = Device_p->FirstScreenRect_p; Next_p != Device_p->LastScreenRect_p; Next_p++)    {        if (Next_p->Overlay_pp != Next_p->Overlays)        {            memory_deallocate(Device_p->CPUPartition_p,Next_p->Overlay_pp);        }    }    /* Free Screen rect list */    memory_deallocate(Device_p->CPUPartition_p,Device_p->FirstScreenRect_p);    /* Overlay Descriptor Data Pool deallocation  */    if (Device_p->OverlayNumber != 0)    {        memory_deallocate(Device_p->CPUPartition_p,Device_p->OverlayDataPool.HandleArray_p);        memory_deallocate(Device_p->CPUPartition_p,Device_p->OverlayDataPool.ElemArray_p);    }    /* Data structure Protection */#ifdef ST_OS21    semaphore_signal (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20    semaphore_signal (&Device_p->AccessControlSemaphore);#endif    /* Delete AccessControlSemaphore */#ifdef ST_OS21    semaphore_delete(Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20    semaphore_delete(&Device_p->AccessControlSemaphore);#endif    /* Free device structure */    memory_deallocate(Device_p->CPUPartition_p,Device_p);    return Err;}/*--------------------------------------------------------------------------------Set Background color----------------------------------------------------------------------------------*/ST_ErrorCode_t STCOMPO_SetBackgroundColor(STCOMPO_Handle_t   CompoHandle,                                          STGXOBJ_Color_t*   BackgroundColor_p){    ST_ErrorCode_t      Err      = ST_NO_ERROR;    stcompo_Device_t*   Device_p = (stcompo_Device_t*)CompoHandle;#ifdef COMPO_ENABLE_SETTINGS_TRACE    COMPO_TRACE("\r\nStt:Setting:StBC:%d",time_now());#endif    /* Data structure Protection */#ifdef ST_OS21    semaphore_wait (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20    semaphore_wait (&Device_p->AccessControlSemaphore);#endif    Device_p->WriteParams.BackgroundColor = *BackgroundColor_p;    /* Update Hal info */    Err = HALCOMPO_SetBackgroundColor(Device_p->HalCompoHandle, BackgroundColor_p);    if(Err != ST_NO_ERROR)    {        /* Data structure Protection */#ifdef ST_OS21        semaphore_signal (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20        semaphore_signal (&Device_p->AccessControlSemaphore);#endif        return(Err);    }   /* UpdateComposition always because there is at least Background color on !*/    Device_p->UpdateComposition = TRUE;    /* Data structure Protection */#ifdef ST_OS21    semaphore_signal (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20    semaphore_signal (&Device_p->AccessControlSemaphore);#endif    return ST_NO_ERROR;}/*--------------------------------------------------------------------------------Set Screen Size----------------------------------------------------------------------------------*/ST_ErrorCode_t STCOMPO_SetScreenSize(STCOMPO_Handle_t CompoHandle, U32 Width, U32 Height){    stcompo_Device_t* Device_p = (stcompo_Device_t*)CompoHandle;#ifdef COMPO_ENABLE_SETTINGS_TRACE    COMPO_TRACE("\r\nStt:Setting:StSS:%d",time_now());#endif    /* Data structure Protection */#ifdef ST_OS21    semaphore_wait (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20    semaphore_wait (&Device_p->AccessControlSemaphore);#endif    Device_p->WriteParams.ScreenWidth  = Width;    Device_p->WriteParams.ScreenHeight = Height;    /* UpdateComposition */    Device_p->UpdateComposition = TRUE;    /* Data structure Protection */#ifdef ST_OS21    semaphore_signal (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20    semaphore_signal (&Device_p->AccessControlSemaphore);#endif    return ST_NO_ERROR;}/*--------------------------------------------------------------------------------Enable/Disable execution----------------------------------------------------------------------------------*/ST_ErrorCode_t STCOMPO_EnableExecution(STCOMPO_Handle_t CompoHandle, BOOL Enable){    stcompo_Device_t* Device_p = (stcompo_Device_t*)CompoHandle;    /* Data structure Protection */#ifdef ST_OS21     semaphore_wait (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20     semaphore_wait (&Device_p->AccessControlSemaphore);#endif    Device_p->ExecutionOn = Enable;    /* Data structure Protection */#ifdef ST_OS21    semaphore_signal (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20    semaphore_signal (&Device_p->AccessControlSemaphore);#endif    return ST_NO_ERROR;}/*--------------------------------------------------------------------------------Set Output bitmap----------------------------------------------------------------------------------*/ST_ErrorCode_t STCOMPO_SetOutputBitmap(STCOMPO_Handle_t   CompoHandle,                                       STGXOBJ_Bitmap_t*  OutputBitmap_p){    ST_ErrorCode_t      Err      = ST_NO_ERROR;    stcompo_Device_t*   Device_p = (stcompo_Device_t*)CompoHandle;#ifdef COMPO_ENABLE_SETTINGS_TRACE    COMPO_TRACE("\r\nStt:Setting:StOB:%d",time_now());#endif    /* Data structure Protection */#ifdef ST_OS21    semaphore_wait (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20    semaphore_wait (&Device_p->AccessControlSemaphore);#endif    Device_p->WriteParams.OutputBitmap = *OutputBitmap_p;    /* Update Hal info */    Err = HALCOMPO_SetOutputBitmap(Device_p->HalCompoHandle, OutputBitmap_p);    if(Err != ST_NO_ERROR)    {        /* Data structure Protection */#ifdef ST_OS21        semaphore_signal (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20        semaphore_signal (&Device_p->AccessControlSemaphore);#endif        return(Err);    }#ifdef DONT_USE_STATIC_BASE_ADDRESS    /* UpdateComposition always because there is at least Background color on !*/    Device_p->UpdateComposition = TRUE;#else     /* Muti-instance support */    if ((((stcompo_Device_t *)CompoHandle)->HalComposeScreen) == HALCOMPO_ComposeScreenAQ)    {        /* UpdateComposition always because there is at least Background color on !*/        Device_p->UpdateComposition = TRUE;    }#endif    /* Data structure Protection */#ifdef ST_OS21    semaphore_signal (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20    semaphore_signal (&Device_p->AccessControlSemaphore);#endif    return Err;}/*--------------------------------------------------------------------------------Get Init alloc params----------------------------------------------------------------------------------*/ST_ErrorCode_t STCOMPO_GetInitAllocParams(STCOMPO_AllocParams_t* Params_p){    HALCOMPO_AllocParams_t AllocParams;    /* Get Node Buffer info */    HALCOMPO_GetInitAllocParams(&AllocParams);    Params_p->NodeSize              = AllocParams.HWNodeSize;    Params_p->NodeAlignment         = AllocParams.HWNodeAlignment;    Params_p->FilterBufferSize      = AllocParams.FilterBufferSize;    Params_p->FilterBufferAlignment = AllocParams.FilterBufferAlignment;    return ST_NO_ERROR;}/*--------------------------------------------------------------------------------Global Flicker Filter management----------------------------------------------------------------------------------*/ST_ErrorCode_t STCOMPO_EnableGlobalFlickerFilter(STCOMPO_Handle_t   CompoHandle){    ST_ErrorCode_t      Err      = ST_NO_ERROR;    stcompo_Device_t*   Device_p = (stcompo_Device_t*)CompoHandle;    /* Data structure Protection */#ifdef ST_OS21    semaphore_wait (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20    semaphore_wait (&Device_p->AccessControlSemaphore);#endif    /* Update Hal info */    Err = HALCOMPO_EnableGlobalFlickerFilter(Device_p->HalCompoHandle);    if(Err != ST_NO_ERROR)    {        /* Data structure Protection */#ifdef ST_OS21        semaphore_signal (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20        semaphore_signal (&Device_p->AccessControlSemaphore);#endif        return(Err);    }    /* UpdateComposition always because there is at least Background color on !*/    Device_p->UpdateComposition = TRUE;    /* Data structure Protection */#ifdef ST_OS21    semaphore_signal (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20    semaphore_signal (&Device_p->AccessControlSemaphore);#endif    return Err;}ST_ErrorCode_t STCOMPO_DisableGlobalFlickerFilter(STCOMPO_Handle_t   CompoHandle){    ST_ErrorCode_t      Err      = ST_NO_ERROR;    stcompo_Device_t*   Device_p = (stcompo_Device_t*)CompoHandle;    /* Data structure Protection */#ifdef ST_OS21    semaphore_wait (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20    semaphore_wait (&Device_p->AccessControlSemaphore);#endif    /* Update Hal info */    Err = HALCOMPO_DisableGlobalFlickerFilter(Device_p->HalCompoHandle);    if(Err != ST_NO_ERROR)    {        /* Data structure Protection */#ifdef ST_OS21        semaphore_signal (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20        semaphore_signal (&Device_p->AccessControlSemaphore);#endif        return(Err);    }    /* UpdateComposition always because there is at least Background color on !*/    Device_p->UpdateComposition = TRUE;    /* Data structure Protection */#ifdef ST_OS21    semaphore_signal (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20    semaphore_signal (&Device_p->AccessControlSemaphore);#endif    return Err;}/*--------------------------------------------------------------------------------Get revision of COMPO API--------------------------------------------------------------------------------*/ST_Revision_t STCOMPO_GetRevision(void){    static const char Revision[] = "COMPO-REL_3.4.2";    /* Revision string format: STXXX-REL_x.x.x                                 /       \ \ \__patch release number  }                            API name      \ \__minor release number  } revision number                                           \__major release number  }        */    return((ST_Revision_t) Revision);}/* End of compo_init.c */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -