You are on page 1of 1

Data Definitions

Syntax:

#use rtos(options)

Elements:

options are separated by comma and may be:


timer=X
Where x is 0-4 specifying the timer
used by the RTOS.
minor_cycle=time

statistics

Purpose:

Where time is a number followed by s,


ms, us, ns. This is the longest time
any task will run. Each task's
execution rate must be a multiple of
this time. The compiler can calculate
this if it is not specified.
Maintain min, max, and total time used
by each task.

This directive tells the compiler which timer on the PIC to use
for monitoring and when to grant control to a task. Changes
to the specified timer's prescaler will effect the rate at which
tasks are executed.
This directive can also be used to specify the longest time
that a task will ever take to execute with the minor_cycle
option. This simply forces all task execution rates to be a
multiple of the minor_cycle before the project will compile
successfully. If the this option is not specified the compiler
will use a minor_cycle value that is the smallest possible
factor of the execution rates of the RTOS tasks.
If the statistics option is specified then the compiler will keep
track of the minimum processor time taken by one execution
of each task, the maximum processor time taken by one
execution of each task, and the total processor time used by
each task.

Examples:
Also See:

#use rtos(timer=0, minor_cycle=20ms)


#task

71

You might also like