Download MMA955xL Intelligent, Motion-Sensing Platform Software

Transcript
Chapter 4 Scheduler Application
A simple task scheduler manages execution of the applications of the
MMA955xL platform. Based on a run-to-completion scheme, the scheduler
features very low cycle and memory overhead.
The scheduler is tightly coupled with the Analog Front End's sampling rate
and is triggered at the start of every sample interval. The system is designed
such that all applications must complete their processing within the sample
interval.
The scheduler handles both Freescale and user applications.
Application
ID
Default speed
0x01
(Runs all the
time)
Configuration
registers
page 42.
Start on
Status
registers
page 42.
Start on
A priority scheme allows short-duration, high-priority tasks. —such as data
sampling and filtering—to preempt long-duration, low-priority tasks.
The scheduler scans serially through the list of applications, looking for applications that have the same
priority as the scheduler's current priority. When there is a priority match, an activity level is checked to
determine if the application should be run in the current scheduler's interval.
An application’s activity mask can be set to High, Low, Both, or None. This feature allows an application
to run during high activity, low activity, both, or not at all. The Sleep/Wake application defines the
thresholds of activity between Sleep and Wake, or High and Low activity.
Priorities from 16 to 23 are linked directly to the frame execution rate. (See Table 4-1 on page 35.) The
lower-priority levels provide a range of values for managing applications in the user system.
The scheduler automatically executes all the applications with a priority corresponding to the scheduler's
current running priority level.
Once the scheduler has identified an application to run, it does a context switch to that application. When
the application completes, context is returned to the scheduler and it looks for more applications with the
same priority.
MMA955xL Intelligent Motion-Sensing Platform Software Reference Manual, Rev. 0
Freescale Semiconductor, Inc.
33