Enable( ), disable( ), and background( ) functions, Error( ) and fatalerr( ) functions – National Instruments AutoCode NI MATRIX User Manual

Page 23

Advertising
background image

Chapter 2

C Language Reference

AutoCode Reference

2-6

ni.com

The

sa_utils.c

file contains comments about each of the routines as they

are used for comparing simulation with generated code results.

After you generate code, link the generated code with

sa_*.o

object files

(refer to Chapter 2, Using AutoCode, of the AutoCode User Guide). For
example, on UNIX platforms:

cc -o

gen_ap

gen_ap.c $ISI/ACC/src/sa_*.o -l other libraries

where

gen_ap

is the name of the generated code file.

enable( ), disable( ), and background( ) Functions

enable( )

unmasks timer interrupts.

disable( )

masks timer interrupts

to prevent re-entry of the scheduler during critical sections.

enable( )

and

disable( )

are not needed in some implementations. These

functions are furnished as stubs and

#defined

as

NULL

in the

sa_utils.h

file.

The

background( )

function, as provided in

sa_utils.c

, merely

invokes the scheduler for the appropriate number of computation cycles
and calls the error handler if any scheduler error occurs.

error( ) and fatalerr( ) Functions

void fatalerr(RT_INTEGER ERROR);

void error(RT_INTEGER NTSK,RT_INTEGER ERRORFLAG);

Implementation_Terminate( )

Perform
implementation-specific
termination tasks.

External_Input( )

Collect external inputs.

External_Output( )

Post external outputs.

Signal_Remote_Dispatch( )

Multiprocessor
implementations only; signal
secondary processors that a
dispatch table is available.

Table 2-4. Target-Specific Utility Routines (Continued)

Routine

Description

Advertising