RTC-Based Execution Scheduling

Description

Use the Real-Time Clock to trigger the Execution Code

This resource uses AON_RTC channel 2 in continuous compare mode to generate periodical wake-ups for the Sensor Controller. These wake-ups are in turn used to trigger the Execution Code at fixed or variable intervals.

Note that the Sensor Controller will wake up at every RTC tick, and that dummy wake-ups in between useful wake-ups will contribute significantly to or dominate the average current consumption. To minimize current consumption:

  • Select the highest possible tickPeriod so that the delay for fwScheduleTask() can be as low as possible
  • If irregular wake-up intervals are required, use the Timer Event Trigger resource instead of RTC-Based Execution Scheduling , and implement the Event Handler Code instead of the Execution Code
  • If the Sensor Controller is operated at different levels of activity, with infrequent switching between the levels, it can make sense to have the System CPU application change the tickPeriod dynamically

The RTC tick period is configured by the System CPU application using the scifStartRtcTicksNow() / scifStartRtcTicks() function. Note that RTC ticks will be skipped silently if the Sensor Controller does not complete its tasks within a single tick interval.

Examples

Initialization Code

// Schedule the first execution at the next RTC tick
fwScheduleTask(1);

Execution Code

// Schedule the next execution five RTC ticks from now
fwScheduleTask(5);

Procedures Overview

Name Brief description
fwResumeRtcEvents() Resumes processing of RTC events for all Sensor Controller tasks. More …
fwScheduleTask() Schedules the next upcoming execution of this task, in number of ticks. More …
fwSuspendRtcEvents() Suspends all processing of RTC events for all Sensor Controller tasks. More …

Constants

None.

Global Variables

None.

Procedures

fwResumeRtcEvents

Prototype: fwResumeRtcEvents()

Resumes processing of RTC events for all Sensor Controller tasks.

fwScheduleTask

Prototype: fwScheduleTask(delay)

Schedules the next upcoming execution of this task, in number of ticks.

Parameter value(s)

  • delay : Delay until next execution (1 = the next tick, 0 = no execution scheduled)

fwSuspendRtcEvents

Prototype: fwSuspendRtcEvents()

Suspends all processing of RTC events for all Sensor Controller tasks.