//----------------------------------------------------------------------------- // COPYRIGHT (C) 2020 CHIPS&MEDIA INC. ALL RIGHTS RESERVED // // This file is distributed under BSD 3 clause and LGPL2.1 (dual license) // SPDX License Identifier: BSD-3-Clause // SPDX License Identifier: LGPL-2.1-only // // The entire notice above must be reproduced on all authorized copies. // // Description : //----------------------------------------------------------------------------- #include "vdi_osal.h" #include "cnm_app.h" #include "cnm_app_internal.h" STATIC CNMAppContext appCtx; Int32 CnmErrorStatus = 0; void CNMAppInit(void) { osal_memset((void*)&appCtx, 0x00, sizeof(CNMAppContext)); osal_init_keyboard(); } BOOL CNMAppAdd(CNMTask task) { CNMTaskContext* taskCtx = (CNMTaskContext*)task; if (appCtx.numTasks >= MAX_NUM_INSTANCE) { return FALSE; } taskCtx->oneTimeRun = TRUE; appCtx.taskList[appCtx.numTasks++] = task; return TRUE; } BOOL CNMAppRun(void) { CNMTask task; Uint32 i; BOOL success; Uint32 runningTask; success = TRUE; runningTask = appCtx.numTasks; for (i=0; i