RTX初始化

初始化函数有以下三个

os_sys_init()

os_sys_init_prio()

os_sys_init_user()

 

1,void os_sys_init( void  (*task) (void) );

void os_sys_init (void (*task)(void) );  /* Task to start */

Description:

The os_sys_init function initializes and starts the Real-Time eXecutive (RTX) kernel.
os_sys_init函数初始化并启动RTX内核。

The task argument points to the task function to start after the kernel is initialized.
参数为在初始化内核之后启动的任务函数。

The RTX kernel gives the task a default priority of 1.
RTX内核将任务的默认优先级设置为1。

The os_sys_init function is in the RL-RTX library. The prototype is defined in rtl.h.
os_sys_init函数位于RL-RTX库中。原型在rtl.h中定义。
 
Note:

The os_sys_init function must be called from the main C function. 
必须从main函数调用os_sys_init函数。

The RTK kernel uses the default stack size, which is defined in rtx_config.c, for the task
RTK内核使用默认堆栈大小,在rtx_config.c中定义。

Return Value: 

The os_sys_init function does not return. Program execution continues with the task identified by the task argument.
os_sys_init函数没有返回值。程序继续执行任务参数标识的任务。

2,void os_sys_init_prio (

                                         void (*task)(void),  /* Task to start */

                                         U8    priority );        /* Task priority (1-254) */

Description:
The os_sys_init_prio function initializes and starts the Real-Time eXecutive (RTX) kernel.
os_sys_init_prio函数初始化并启动RTX内核。

The task argument points to the task to start after the kernel is initialized.
任务参数指向内核初始化后要启动的任务。

The priority argument specifies the priority for the task. The default task priority is 1. 
Priority 0 is reserved for the Idle Task. If a value of 0 is specified for the priority, it is automatically replaced with a value of 1. Priority 255 is also reserved.
priority参数指定任务的优先级。默认任务优先级为1。优先级0保留给IDLE任务。如果为优先级指定了一个值0,那么它将被自动替换一个值1。优先级255也被保留。

The os_sys_init_prio function is in the RL-RTX library. The prototype is defined in rtl.h.
os_sys_init_prio函数位于RL-RTX库中。原型在rtl.h中定义。

Note:
The os_sys_init_prio function must be called from the main C function. 
必须从main函数调用os_sys_init_prio函数。

The RTK kernel uses the default stack size, which is defined in rtx_config.c, for the task.
RTK内核使用默认堆栈大小,它在rtx_config.c中定义。 

Priority value of 255 represents the most important task.
优先级值255表示最重要的任务。 
 
Return Value:
The os_sys_init_prio function does not return. Program execution continues with the task identified by the task argument.
os_sys_init_prio函数不返回。程序继续执行任务参数标识的任务。

3, void os_sys_init_user (

                             void (*task)(void),   /* Task to start */

                             U8       priority,        /* Task priority (1-254) */

                             void*   stack,           /* Task stack */

                             U16      size);           /* Stack size */

Description:
The os_sys_init_user function initializes and starts the Real-Time eXecutive (RTX) kernel. Use this function when you must specify a large stack for the starting task.
os_sys_init_user函数初始化并启动RTX内核。当必须为启动任务指定大型堆栈时,请使用此函数。

The task argument points to the task function to start after the kernel is initialized.
任务参数指向要在初始化内核之后启动的任务函数。

The priority argument specifies the priority for the task. The default task priority is 1. Priority 0 is reserved for the Idle Task. If a value of 0 is specified for the priority, it is automatically replaced with a value of 1. Priority 255 is also reserved.
priority参数指定任务的优先级。默认任务优先级为1。优先级0保留给空闲任务。如果为优先级指定了一个值0,那么它将被一个值1自动替换。优先级255也被保留。

The stack argument points to a memory block reserved for the stack to use for the task. The size argument specifies the size of the stack in bytes.
stack参数指向为堆栈保留的用于任务的内存块。size参数以字节为单位指定堆栈的大小。

The os_sys_init_user function is in the RL-RTX library. The prototype is defined in rtl.h.
os_sys_init_user函数位于RL-RTX库中。原型在rtl.h中定义。

Note:

The os_sys_init_user function must be called from the main C function. 
必须从main函数调用os_sys_init_user函数。
The stack must be aligned at an 8-byte boundary and must be declared as an array of type U64 (unsigned long long). 
堆栈必须在8字节边界上对齐,并且必须声明为类型为U64 (unsigned long long)的数组。
The default stack size is defined in rtx_config.c. 
默认堆栈大小在rtx_config.c中定义。
Priority value of 255 represents the most important task. 
优先级值255表示最重要的任务。

Return Value:
The os_sys_init_user function does not return. Program execution continues with the task identified by the task argument.
os_sys_init_user函数不返回。程序继续执行任务参数标识的任务。

 

你可能感兴趣的:(嵌入式实时操作系统—RTX)