Configuring the micrium µc/os-ii operating system, Configuring the micrium μc/os-ii operating system, Maximum number of tasks – Echelon FTXL User Manual

Page 177: Configuring the micrium μc/os-ii, Operating system, 165, descr

Advertising
background image

FTXL User’s Guide

165

priority tasks (OS_HIGH_PRIORITY_BASE) set to 4. The figure assumes that

low numbers represent high priorities. The cross-hatch shaded numbers
represent the desired configuration of one high-priority application task (at

priority 7), two medium-priority application tasks (at priorities 13 and 14), and

three low-priority application tasks (at priorities 17, 18, and 19).

4

5

6

10

9

11

8

12

15 16

7

17

13

19

14

OS_APPLICATION_HIGH_PRIORITY_BASE

OS_APPLICATION_PRIORITY_BASE

OS_APPLICATION_LOW_PRIORITY_BASE

18

#define NUM_RESERVED_HIGH_PRIORITY_APPLICATION_TASKS 1
#define NUM_RESERVED_APPLICATION_PRIORITIES 2

OS_HIGH_PRIORITY_BASE

OS_MEDIUM_PRIORITY_BASE

OS_LOW_PRIORITY_BASE

#define OS_HIGH_PRIORITY_BASE 4

Figure 16. Example Priority Configuration

Configuring the Micrium µC/OS-II Operating System

The example applications that are included with the FTXL Developer’s Kit
provide a working configuration for the Micrium μC/OS-II operating system.

However, you can modify this configuration, for example, to increase the number
of application tasks or increase the number of event control blocks (for critical

sections and binary semaphores).
To configure the Micrium μC/OS-II operating system, you must calculate the
resources that are required for both the FTXL LonTalk protocol stack and for

your application program. The primary resources that you need to calculate are:

• The maximum number of tasks
• The lowest assignable task priority
• The maximum number of event control blocks

Maximum Number of Tasks

The μC/OS-II operating system uses at least two tasks of its own (the highest and

lowest priority tasks), and also uses a third task if you enable the statistics task.
In addition to these operating system tasks, you must add 10 tasks for the FTXL

LonTalk protocol stack tasks, and any additional application tasks that your

application requires. Be sure to set the
NUM_RESERVED_HIGH_PRIORITY_APPLICATION_TASKS and

NUM_RESERVED_APPLICATION_PRIORITIES macros appropriately; see

Specifying Task Priorities

on page 161.

For the default configuration of a single application task and two operating

system tasks, you need a total of 13 tasks. If you enable the μC/OS-II statistics

task, you need a total of 14 tasks.

Advertising