tailieunhanh - Real-Time Embedded Multithreading Using ThreadX and MIPS- P3

Real-Time Embedded Multithreading Using ThreadX and MIPS- P3:Although the history of embedded systems is relatively short, 1 the advances and successes of this fi eld have been profound. Embedded systems are found in a vast array of applications such as consumer electronics, “ smart ” devices, communication equipment, automobiles, desktop computers, and medical equipment. | 36 Chapter 4 Memory block pool control block Memory block pool name Number of bytes in each memory block Location of memory block pool Total number of bytes available Figure Attributes of a memory block pool The total number of memory blocks in a memory block pool can be calculated as follows Total Number of Bytes Available Total Number of Blocks ---------------------------------------------------------- Number of Bytes in Each Memory Block sizeof void Each memory block contains one pointer of overhead that is invisible to the user and is represented by the sizeof void expression in the preceding formula. Avoid wasting memory space by correctly computing the total number of bytes to allocate based on the number of desired memory blocks. Application Timer Fast response to asynchronous external events is the most important function of real-time embedded applications. However many of these applications must also perform certain activities at predetermined intervals of time. Application timers enable applications to execute application C functions at specific intervals of time. It is also possible for an application timer to expire only once. This type of timer is called a one-shot timer while repeating interval timers are called periodic timers. Each application timer is a public resource. Figure contains the attributes of an application timer. Every application timer must have a Control Block that contains essential system information. Every application timer is assigned a name which is used primarily for identification purposes. Other attributes include the name of the expiration function that is executed when the timer expires. Another attribute is a value that is passed to the expiration function. This value is for se purchase PDF Ple on to remove this watermark. RTOS Building Blocks for System Development 37 Application timer control block Application timer name Expiration function to call Expiration input value to pass to