System CPU Alert

Description

Basic ALERT interrupt generation from task code

This resource allows the task code running on the Sensor Controller to generate an ALERT callback via the SCIF driver to the application running on the System CPU. If the System CPU is sleeping at that time, it will wake up.

This resource may be used when input and/or output data are single-buffered, or when a custom buffering scheme is used (for example a ring buffer).

There are two different procedures for ALERT interrupt generation:

  • fwGenAlertInterrupt() :
    • Use when:
      • The task code completes within a short period of time
      • The task code needs only to generate a single ALERT interrupt per iteration
    • The ALERT interrupt generation takes effect at the end of the Sensor Controller wake-up, after all executed tasks have finished. If multiple tasks generate ALERT interrupt during the same wake-up, these will be communicated through a single ALERT event callback from the SCIF driver.
    • The task generating the interrupt is identified by scifGetAlertEvents() .
  • fwGenQuickAlertInterrupt() :
    • Use when:
      • The task code runs continuously for longer periods of time
      • The task code needs to generate ALERT interrupt multiple times per iteration
    • The ALERT interrupt generation takes effect immediately
    • The task generating the interrupt is not identified by scifGetAlertEvents() .

For details on how to handle ALERT interrupts, see the SCIF driver documentation. Note that:

  • ALERT interrupts from fwGenAlertInterrupt() can be merged (but not lost) if generated at a faster rate than the System CPU application can handle
  • ALERT interrupts from fwGenQuickAlertInterrupt() can be merged or lost if generated at a faster rate than the System CPU application can handle

Examples

System CPU Wake-Up

// Notify the application if the ADC value is high
if (output.adcValue > 1000) {
    output.intFlags |= INT_ADC_VALUE_HIGH;
    fwGenAlertInterrupt();
}

Procedures Overview

Name Brief description
fwGenAlertInterrupt() Generates an ALERT interrupt to the System CPU application. More …
fwGenQuickAlertInterrupt() Generates an ALERT interrupt to the System CPU application. More …

Constants

None.

Global Variables

None.

Procedures

fwGenAlertInterrupt

Prototype: fwGenAlertInterrupt()

Generates an ALERT interrupt to the System CPU application.

The interrupt occurs after the task code block has finished. If multiple tasks are scheduled to execute at the same time, the interrupt occurs after all the tasks have finished.

This procedure may only be called once per iteration of a task.

fwGenQuickAlertInterrupt

Prototype: fwGenQuickAlertInterrupt()

Generates an ALERT interrupt to the System CPU application.

The interrupt occurs immediately.

This procedure should be used by a task that runs for a longer period of time and needs to alert the System CPU repeatedly during this time.

This procedure does not set flags in the bit-vector returned by scifGetAlertEvents() .