//------------------------------------------------------------------------------ tOplkError ctrlk_init(tCtrlkExecuteCmdCb pfnExecuteCmdCb_p) { tOplkError ret = kErrorOk; if ((ret = ctrlkcal_init()) != kErrorOk) { DEBUG_LVL_ERROR_TRACE("ctrlkcal_init failed!\n"); goto ExitCleanup; } // initialize heartbeat counter instance_l.heartbeat = 1; setupKernelFeatures(); instance_l.pfnExecuteCmdCb = pfnExecuteCmdCb_p; return kErrorOk; ExitCleanup: ctrlkcal_exit(); return ret; }
//------------------------------------------------------------------------------ tOplkError ctrlk_init(tCtrlkExecuteCmdCb pfnExecuteCmdCb_p) { tOplkError ret; // Reset the instance OPLK_MEMSET(&instance_l, 0, sizeof(instance_l)); ret = ctrlkcal_init(); if (ret != kErrorOk) { DEBUG_LVL_ERROR_TRACE("ctrlkcal_init failed!\n"); ctrlkcal_exit(); goto Exit; } // initialize heartbeat counter instance_l.heartbeat = 1; setupKernelFeatures(); instance_l.pfnExecuteCmdCb = pfnExecuteCmdCb_p; Exit: return ret; }