Chapter 3
Kernel Structure
This chapter describes some of the structural aspects of µC/OS-II. You will learn
...
Figure 3.1 µC/OS-II File Structure.
Table of Contents |
---|
Critical Sections, OS_ENTER_CRITICAL() and OS_EXIT_CRITICAL()
...
Code Block |
---|
#define OS_ENTER_CRITICAL() \ cpu_sr = get_processor_psw(); \ disable_interrupts(); #define OS_EXIT_CRITICAL() \ set_processor_psw(cpu_sr); |
Tasks
A task is typically an infinite loop function as shown in Listing 3.2.
Alternatively, the task can delete itself upon completion as shown in Listing 3.3. Note that the task code is not actually deleted; µC/OS-II simply doesn’t know about the task anymore, so the task code will not run. Also, if the task calls OSTaskDel()
, the task never returns.
...