Getting Started with μC/OS-III
L3-2(12)
The last argument of OSTaskCreate() is a pointer to a variable that will
receive an error code. If OSTaskCreate() is successful, the error code will be
OS_ERR_NONE otherwise, look up the value of the error code in OS.H (See
OS_ERR_xxxx ) to determine the problem with the call.
L3-2(13)
The final step in main() is to call OSStart() , which starts the multitasking
process. Specifically, μC/OS-III will select the highest-priority task that was
created before calling OSStart() . The highest-priority task is always
OS_IntQTask() if that task is enabled in
OS_CFG.H (through the
OS_CFG_ISR_POST_DEFERRED_EN constant). If this is the case, OS_IntQTask()
will perform some initialization of its own and then μC/OS-III will switch to the
next most important task that was created.
A few important points are worth noting. For one thing, create as many tasks as you want
before calling OSStart() . However, it is recommended to only create one task as shown in
the example because, having a single application task allows μC/OS-III to determine how
fast the CPU is, in order to determine the percentage of CPU usage at run-time. Also, if the
application needs other kernel objects such as semaphores and message queues then it is
recommended that these be created prior to calling OSStart() . Finally, notice that that
interrupts are not enabled. This will be discussed next by examining the contents of
AppTaskStart() , which is shown in Listing 3-3.
57
相关PDF资料
AD-UCUSBD-SPRD PRD LIC UCUSB DEV CORE CCES SGL
AD637-EVALZ BOARD EVALUATION FOR AD637
AD736-EVALZ BOARD EVALUATION FOR AD736
AD737-EVALZ BOARD EVALUATION FOR AD737
AD8007AKS-EBZ BOARD EVAL FOR AD8007AKS
AD8018ARU-EVAL BOARD EVAL FOR AD8018
AD8034ART-EBZ BOARD EVAL FOR AD8034ART
AD8040AR-EBZ BOARD EVAL FOR AD8040AR
相关代理商/技术参数
ADUCOSC100 制造商:Analog Devices 功能描述:ADC - Rail/Tube
ADUCOSC100-REEL 功能描述:DAC MICROCONVERTER DUAL TSSOP 制造商:analog devices inc. 系列:* 零件状态:上次购买时间 标准包装:1
ADUCOSC100-REEL7 功能描述:DAC MICROCONVERTER DUAL TSSOP 制造商:analog devices inc. 系列:* 零件状态:上次购买时间 标准包装:1
ADUCOSCZ100 制造商:Analog Devices 功能描述:
ADUCOSCZ100-REEL7 制造商:Analog Devices 功能描述:ANAADUCOSCZ100-REEL7 12 BIT ADC WITH EMB
ADuC-P7026 功能描述:开发板和工具包 - ARM PROTOTYPE BRD FOR ADUC7026 ARM7 RoHS:否 制造商:Arduino 产品:Development Boards 工具用于评估:ATSAM3X8EA-AU 核心:ARM Cortex M3 接口类型:DAC, ICSP, JTAG, UART, USB 工作电源电压:3.3 V
ADUCRF101 制造商:Analog Devices 功能描述:PRECISION ANALOG MICRCONTROLLER - Tape and Reel
ADUCRF101BCPZ128 制造商:Analog Devices 功能描述:PRECISION ANALOG MICROCONTROLLER WITH RF TRANSCEIVER, ARM CO - Trays