Home |
RTKernel-32 Programming Manual Function RTKernelInit |
Function RTKernelInitFunction RTKernelInit initializes RTKernel-32: RTKTaskHandle RTKernelInit(unsigned MainPrio); ParametersMainPrioDefines the priority of the main task. If it is zero, RTKConfig.MainPriority is used. If RTKConfig.MainPriority is also zero, RTKConfig.DefaultPriority is used. A floating point context is maintained for the main task if RF_FPCONTEXT is set in RTKConfig.Flags. return valueThe task handle of the main task is returned. RTKernelInit will call the initialization routines of all drivers, install its low-level interrupt handlers for all IRQs specified in RTKConfig.HookedIRQs, create the Idle Task(s), and install an exit function using run-time system function atexit(). If the program is running under the RTTarget-32 Debug Monitor and kernel flag RF_NO_EXIT_TASK has not been set, an Exit Task is installed with: RTKInstallExitTask(0, 0, NULL); RTCallDebugger(RT_DBG_CALLRESET, (DWORD)RTKExit, 0); RTSetExitHandler(RTKExit); If the kernel has already been initialized through a previous explicit or implicit call to RTKernelInit, only the priority of the main task is set and no other actions are performed. Before tasks can be created, RTKernel-32 must be initialized by function RTKernelInit. RTKernelInit must either be called explicitly by the application or implicitly by the first RTKCreateThread call of the program. Automatic initialization can be disabled by unsetting the RF_AUTOINIT flag in RTKConfig.Flags.
|