\hypertarget{BFC_8c}{
\section{BFC.c File Reference}
\label{BFC_8c}\index{BFC.c@{BFC.c}}
}
Balloon Flight Control, Implementation. 


{\tt \#include $<$vx\-Works.h$>$}\par
{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include $<$sys\-Lib.h$>$}\par
{\tt \#include $<$tick\-Lib.h$>$}\par
{\tt \#include $<$wd\-Lib.h$>$}\par
{\tt \#include \char`\"{}BBC/FPA.h\char`\"{}}\par
{\tt \#include \char`\"{}BFU/BFC.h\char`\"{}}\par
\subsection*{Data Structures}
\begin{CompactItemize}
\item 
struct \hyperlink{struct__BFC__msgDst}{\_\-BFC\_\-msg\-Dst}
\begin{CompactList}\small\item\em Defines a BFC message destination.\item\end{CompactList}\item 
struct \hyperlink{struct__BFC__rto}{\_\-BFC\_\-rto}
\begin{CompactList}\small\item\em Defines a BFC run timeout control structure.\item\end{CompactList}\item 
struct \hyperlink{struct__BFC__runCtl}{\_\-BFC\_\-run\-Ctl}
\begin{CompactList}\small\item\em Encapsulates the information needed to control a run.\item\end{CompactList}\end{CompactItemize}
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define \hyperlink{BFC_8c_a0}{BFC\_\-M\_\-RUN\_\-ACTIVE}
\begin{CompactList}\small\item\em A bit mask, where the set bits indicate states which occur during an active run.\item\end{CompactList}\item 
\#define \hyperlink{BFC_8c_a1}{\_\-TICKS}(\_\-time, \_\-scale\_\-factor, \_\-ticks\_\-per\_\-second)\ ((\_\-time $\ast$ \_\-ticks\_\-per\_\-second) / \_\-scale\_\-factor)
\begin{CompactList}\small\item\em Converts a time to Vx\-Works Ticks.\item\end{CompactList}\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
typedef \hyperlink{struct__BFC__msgDst}{\_\-BFC\_\-msg\-Dst} \hyperlink{BFC_8c_a2}{BFC\_\-msg\-Dst}
\begin{CompactList}\small\item\em Typedef for struct \hyperlink{struct__BFC__msgDst}{\_\-BFC\_\-msg\-Dst}.\item\end{CompactList}\item 
typedef \hyperlink{struct__BFC__rto}{\_\-BFC\_\-rto} \hyperlink{BFC_8c_a3}{BFC\_\-rto}
\begin{CompactList}\small\item\em Typedef for struct \hyperlink{struct__BFC__rto}{\_\-BFC\_\-rto}.\item\end{CompactList}\item 
typedef int($\ast$ \hyperlink{BFC_8c_a4}{BFC\_\-set\-Rtn} )(\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc, unsigned int value)
\begin{CompactList}\small\item\em Typedef for generic set routine.\item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
int \hyperlink{BFC_8c_a5}{destroy} (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc)
\begin{CompactList}\small\item\em Returns all the resources associated with the run control block.\item\end{CompactList}\item 
int \hyperlink{BFC_8c_a6}{run\-Is\-Active} (\hyperlink{BFC_8h_a0}{BFC\_\-run\-State} state)
\begin{CompactList}\small\item\em Indicates whether the specified run state occurs while a run is active.\item\end{CompactList}\item 
FPA\_\-fcb $\ast$ \hyperlink{BFC_8c_a7}{msgs\-Init} (int nmsgs, int msg\-Size)
\begin{CompactList}\small\item\em Initializes a fixed packet pool to contain {\em nmsgs}.\item\end{CompactList}\item 
void \hyperlink{BFC_8c_a8}{msg\-Init} (void $\ast$unused, void $\ast$msg, int size, int loff)
\begin{CompactList}\small\item\em Initializes each packet as it is put on the free list.\item\end{CompactList}\item 
void \hyperlink{BFC_8c_a9}{rto\-Rtn} (\hyperlink{BFC_8c_a3}{BFC\_\-rto} $\ast$rto)
\begin{CompactList}\small\item\em Watchdog timer routine to signal the end of a run.\item\end{CompactList}\item 
\hypertarget{BFC_8c_a10}{
\index{BFC_get@{BFC\_\-get}!BFC.c@{BFC.c}}\index{BFC.c@{BFC.c}!BFC_get@{BFC\_\-get}}
\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$ {\bf BFC\_\-get} (void)}
\label{BFC_8c_a10}

\item 
\hypertarget{BFC_8c_a11}{
\index{BFC_init@{BFC\_\-init}!BFC.c@{BFC.c}}\index{BFC.c@{BFC.c}!BFC_init@{BFC\_\-init}}
int {\bf BFC\_\-init} (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc, \hyperlink{BFI_8h_a11}{BFI\_\-group} group, unsigned int rto\_\-signal, unsigned int msg\_\-signal, int nmsgs, int msg\-Size)}
\label{BFC_8c_a11}

\item 
\hypertarget{BFC_8c_a12}{
\index{BFC_blimitSet@{BFC\_\-blimitSet}!BFC.c@{BFC.c}}\index{BFC.c@{BFC.c}!BFC_blimitSet@{BFC\_\-blimit\-Set}}
int {\bf BFC\_\-blimit\-Set} (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc, unsigned int nbytes)}
\label{BFC_8c_a12}

\item 
\hypertarget{BFC_8c_a13}{
\index{BFC_elimitSet@{BFC\_\-elimitSet}!BFC.c@{BFC.c}}\index{BFC.c@{BFC.c}!BFC_elimitSet@{BFC\_\-elimit\-Set}}
int {\bf BFC\_\-elimit\-Set} (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc, unsigned int nevts)}
\label{BFC_8c_a13}

\item 
\hypertarget{BFC_8c_a14}{
\index{BFC_maxBlimitSet@{BFC\_\-maxBlimitSet}!BFC.c@{BFC.c}}\index{BFC.c@{BFC.c}!BFC_maxBlimitSet@{BFC\_\-max\-Blimit\-Set}}
int {\bf BFC\_\-max\-Blimit\-Set} (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc, unsigned int nbytes)}
\label{BFC_8c_a14}

\item 
\hypertarget{BFC_8c_a15}{
\index{BFC_tlimitSet@{BFC\_\-tlimitSet}!BFC.c@{BFC.c}}\index{BFC.c@{BFC.c}!BFC_tlimitSet@{BFC\_\-tlimit\-Set}}
int {\bf BFC\_\-tlimit\-Set} (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc, unsigned int msecs)}
\label{BFC_8c_a15}

\item 
\hypertarget{BFC_8c_a16}{
\index{BFC_quantitySet@{BFC\_\-quantitySet}!BFC.c@{BFC.c}}\index{BFC.c@{BFC.c}!BFC_quantitySet@{BFC\_\-quantity\-Set}}
int {\bf BFC\_\-quantity\-Set} (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc, \hyperlink{BFC_8h_a3}{BFC\_\-quantity} name, unsigned int value)}
\label{BFC_8c_a16}

\item 
\hypertarget{BFC_8c_a17}{
\index{BFC_runIsActive@{BFC\_\-runIsActive}!BFC.c@{BFC.c}}\index{BFC.c@{BFC.c}!BFC_runIsActive@{BFC\_\-run\-Is\-Active}}
int {\bf BFC\_\-run\-Is\-Active} (const \hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc)}
\label{BFC_8c_a17}

\item 
\hypertarget{BFC_8c_a18}{
\index{BFC_runNumberSet@{BFC\_\-runNumberSet}!BFC.c@{BFC.c}}\index{BFC.c@{BFC.c}!BFC_runNumberSet@{BFC\_\-run\-Number\-Set}}
int {\bf BFC\_\-run\-Number\-Set} (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc, unsigned int run\-Number)}
\label{BFC_8c_a18}

\item 
\hypertarget{BFC_8c_a19}{
\index{BFC_runStart@{BFC\_\-runStart}!BFC.c@{BFC.c}}\index{BFC.c@{BFC.c}!BFC_runStart@{BFC\_\-run\-Start}}
int {\bf BFC\_\-run\-Start} (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc, \hyperlink{BFC_8h_a8}{BFC\_\-run\-Usr\-Rtn} usr, void $\ast$prm1, void $\ast$prm2)}
\label{BFC_8c_a19}

\item 
\hypertarget{BFC_8c_a20}{
\index{BFC_runPause@{BFC\_\-runPause}!BFC.c@{BFC.c}}\index{BFC.c@{BFC.c}!BFC_runPause@{BFC\_\-run\-Pause}}
int {\bf BFC\_\-run\-Pause} (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc, \hyperlink{BFC_8h_a8}{BFC\_\-run\-Usr\-Rtn} usr, void $\ast$prm1, void $\ast$prm2)}
\label{BFC_8c_a20}

\item 
\hypertarget{BFC_8c_a21}{
\index{BFC_runResume@{BFC\_\-runResume}!BFC.c@{BFC.c}}\index{BFC.c@{BFC.c}!BFC_runResume@{BFC\_\-run\-Resume}}
int {\bf BFC\_\-run\-Resume} (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc, \hyperlink{BFC_8h_a8}{BFC\_\-run\-Usr\-Rtn} usr, void $\ast$prm1, void $\ast$prm2)}
\label{BFC_8c_a21}

\item 
\hypertarget{BFC_8c_a22}{
\index{BFC_runStop@{BFC\_\-runStop}!BFC.c@{BFC.c}}\index{BFC.c@{BFC.c}!BFC_runStop@{BFC\_\-run\-Stop}}
int {\bf BFC\_\-run\-Stop} (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc, \hyperlink{BFC_8h_a8}{BFC\_\-run\-Usr\-Rtn} usr, void $\ast$prm1, void $\ast$prm2)}
\label{BFC_8c_a22}

\item 
\hypertarget{BFC_8c_a23}{
\index{BFC_runUpdate@{BFC\_\-runUpdate}!BFC.c@{BFC.c}}\index{BFC.c@{BFC.c}!BFC_runUpdate@{BFC\_\-run\-Update}}
int {\bf BFC\_\-run\-Update} (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc, unsigned int nevts, unsigned int nbytes)}
\label{BFC_8c_a23}

\item 
\hypertarget{BFC_8c_a24}{
\index{BFC_configure@{BFC\_\-configure}!BFC.c@{BFC.c}}\index{BFC.c@{BFC.c}!BFC_configure@{BFC\_\-configure}}
int {\bf BFC\_\-configure} (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc, unsigned int elimit, unsigned int tlimit, unsigned int blimit)}
\label{BFC_8c_a24}

\item 
\hypertarget{BFC_8c_a25}{
\index{BFC_msgAllocate@{BFC\_\-msgAllocate}!BFC.c@{BFC.c}}\index{BFC.c@{BFC.c}!BFC_msgAllocate@{BFC\_\-msg\-Allocate}}
\hyperlink{BFC_8h_a7}{BFC\_\-msg} $\ast$ {\bf BFC\_\-msg\-Allocate} (\hyperlink{BFC_8h_a6}{BFC\_\-msg\-Stream} $\ast$mstrm, int timeout)}
\label{BFC_8c_a25}

\item 
\hypertarget{BFC_8c_a26}{
\index{BFC_msgQue@{BFC\_\-msgQue}!BFC.c@{BFC.c}}\index{BFC.c@{BFC.c}!BFC_msgQue@{BFC\_\-msg\-Que}}
int {\bf BFC\_\-msg\-Que} (\hyperlink{BFC_8h_a6}{BFC\_\-msg\-Stream} $\ast$mstrm, \hyperlink{BFC_8h_a7}{BFC\_\-msg} $\ast$msg, unsigned int type, unsigned int prm)}
\label{BFC_8c_a26}

\item 
\hypertarget{BFC_8c_a27}{
\index{BFC_msgStreamInit@{BFC\_\-msgStreamInit}!BFC.c@{BFC.c}}\index{BFC.c@{BFC.c}!BFC_msgStreamInit@{BFC\_\-msg\-Stream\-Init}}
int {\bf BFC\_\-msg\-Stream\-Init} (\hyperlink{BFC_8h_a6}{BFC\_\-msg\-Stream} $\ast$mstrm, \hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc, int ack\-To)}
\label{BFC_8c_a27}

\item 
\hypertarget{BFC_8c_a28}{
\index{BFC_msgSend@{BFC\_\-msgSend}!BFC.c@{BFC.c}}\index{BFC.c@{BFC.c}!BFC_msgSend@{BFC\_\-msg\-Send}}
int {\bf BFC\_\-msg\-Send} (\hyperlink{BFC_8h_a6}{BFC\_\-msg\-Stream} $\ast$mstrm, unsigned int type, unsigned int prm)}
\label{BFC_8c_a28}

\item 
\hypertarget{BFC_8c_a29}{
\index{BFC_msgReceive@{BFC\_\-msgReceive}!BFC.c@{BFC.c}}\index{BFC.c@{BFC.c}!BFC_msgReceive@{BFC\_\-msg\-Receive}}
\hyperlink{BFC_8h_a7}{BFC\_\-msg} $\ast$ {\bf BFC\_\-msg\-Receive} (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc)}
\label{BFC_8c_a29}

\item 
\hypertarget{BFC_8c_a30}{
\index{BFC_msgAcknowledge@{BFC\_\-msgAcknowledge}!BFC.c@{BFC.c}}\index{BFC.c@{BFC.c}!BFC_msgAcknowledge@{BFC\_\-msg\-Acknowledge}}
int {\bf BFC\_\-msg\-Acknowledge} (\hyperlink{BFC_8h_a7}{BFC\_\-msg} $\ast$msg, int status)}
\label{BFC_8c_a30}

\item 
\hypertarget{BFC_8c_a31}{
\index{BFC_runInfoGet@{BFC\_\-runInfoGet}!BFC.c@{BFC.c}}\index{BFC.c@{BFC.c}!BFC_runInfoGet@{BFC\_\-run\-Info\-Get}}
const \hyperlink{BFC_8h_a4}{BFC\_\-run\-Info} $\ast$ {\bf BFC\_\-run\-Info\-Get} (const \hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc)}
\label{BFC_8c_a31}

\item 
\hypertarget{BFC_8c_a32}{
\index{BFC_runStateGet@{BFC\_\-runStateGet}!BFC.c@{BFC.c}}\index{BFC.c@{BFC.c}!BFC_runStateGet@{BFC\_\-run\-State\-Get}}
\hyperlink{BFC_8h_a0}{BFC\_\-run\-State} {\bf BFC\_\-run\-State\-Get} (const \hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc)}
\label{BFC_8c_a32}

\item 
\hypertarget{BFC_8c_a33}{
\index{BFC_runNumberGet@{BFC\_\-runNumberGet}!BFC.c@{BFC.c}}\index{BFC.c@{BFC.c}!BFC_runNumberGet@{BFC\_\-run\-Number\-Get}}
unsigned int {\bf BFC\_\-run\-Number\-Get} (const \hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc)}
\label{BFC_8c_a33}

\item 
\hypertarget{BFC_8c_a34}{
\index{BFC_timeLeftGet@{BFC\_\-timeLeftGet}!BFC.c@{BFC.c}}\index{BFC.c@{BFC.c}!BFC_timeLeftGet@{BFC\_\-time\-Left\-Get}}
int {\bf BFC\_\-time\-Left\-Get} (const \hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc)}
\label{BFC_8c_a34}

\item 
\hypertarget{BFC_8c_a35}{
\index{BFC_nbytesLeftGet@{BFC\_\-nbytesLeftGet}!BFC.c@{BFC.c}}\index{BFC.c@{BFC.c}!BFC_nbytesLeftGet@{BFC\_\-nbytes\-Left\-Get}}
int {\bf BFC\_\-nbytes\-Left\-Get} (const \hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc)}
\label{BFC_8c_a35}

\item 
\hypertarget{BFC_8c_a36}{
\index{BFC_nevtsLeftGet@{BFC\_\-nevtsLeftGet}!BFC.c@{BFC.c}}\index{BFC.c@{BFC.c}!BFC_nevtsLeftGet@{BFC\_\-nevts\-Left\-Get}}
int {\bf BFC\_\-nevts\-Left\-Get} (const \hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc)}
\label{BFC_8c_a36}

\item 
\hypertarget{BFC_8c_a37}{
\index{BFC_tlimitGet@{BFC\_\-tlimitGet}!BFC.c@{BFC.c}}\index{BFC.c@{BFC.c}!BFC_tlimitGet@{BFC\_\-tlimit\-Get}}
int {\bf BFC\_\-tlimit\-Get} (const \hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc)}
\label{BFC_8c_a37}

\item 
\hypertarget{BFC_8c_a38}{
\index{BFC_maxBlimitGet@{BFC\_\-maxBlimitGet}!BFC.c@{BFC.c}}\index{BFC.c@{BFC.c}!BFC_maxBlimitGet@{BFC\_\-max\-Blimit\-Get}}
int {\bf BFC\_\-max\-Blimit\-Get} (const \hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc)}
\label{BFC_8c_a38}

\end{CompactItemize}


\subsection{Detailed Description}
Balloon Flight Control, Implementation.



\begin{Desc}
\item[Author: ]\par
JJRussell - \href{mailto:russell@slac.stanford.edu}{\tt russell@slac.stanford.edu}\end{Desc}


\subsection{Define Documentation}
\hypertarget{BFC_8c_a1}{
\index{BFC.c@{BFC.c}!_TICKS@{\_\-TICKS}}
\index{_TICKS@{\_\-TICKS}!BFC.c@{BFC.c}}
\subsubsection[\_\-TICKS]{\setlength{\rightskip}{0pt plus 5cm}\#define \_\-TICKS(\_\-time, \_\-scale\_\-factor, \_\-ticks\_\-per\_\-second)\ ((\_\-time $\ast$ \_\-ticks\_\-per\_\-second) / \_\-scale\_\-factor)}}
\label{BFC_8c_a1}


Converts a time to Vx\-Works Ticks.



 A time, \_\-time, expressed in some units, {\em \_\-scale\_\-factor}, is converted to Vx\-Works ticks. The calculation is straightforward.\par




\footnotesize\begin{verbatim}
    ticks = (time * ticks_per_second) / scale_factor
  \end{verbatim}\normalsize 


For example, if one had a time, expressed in milliseconds, then



\footnotesize\begin{verbatim}
    ticks = _TICKS(time_in_msecs, 1000, sysClkRateGet())
  \end{verbatim}\normalsize 
 \hypertarget{BFC_8c_a0}{
\index{BFC.c@{BFC.c}!BFC_M_RUN_ACTIVE@{BFC\_\-M\_\-RUN\_\-ACTIVE}}
\index{BFC_M_RUN_ACTIVE@{BFC\_\-M\_\-RUN\_\-ACTIVE}!BFC.c@{BFC.c}}
\subsubsection[BFC\_\-M\_\-RUN\_\-ACTIVE]{\setlength{\rightskip}{0pt plus 5cm}\#define BFC\_\-M\_\-RUN\_\-ACTIVE}}
\label{BFC_8c_a0}


{\bf Value:}

\footnotesize\begin{verbatim}(((1 << (BFC_K_STATE_STOPPING - BFC_K_STATE_STARTED + 1)) -1) \
         <<  BFC_K_STATE_STARTED)\end{verbatim}\normalsize 
A bit mask, where the set bits indicate states which occur during an active run.



\subsection{Typedef Documentation}
\hypertarget{BFC_8c_a2}{
\index{BFC.c@{BFC.c}!BFC_msgDst@{BFC\_\-msgDst}}
\index{BFC_msgDst@{BFC\_\-msgDst}!BFC.c@{BFC.c}}
\subsubsection[BFC\_\-msgDst]{\setlength{\rightskip}{0pt plus 5cm}BFC\_\-msg\-Dst}}
\label{BFC_8c_a2}


Typedef for struct \hyperlink{struct__BFC__msgDst}{\_\-BFC\_\-msg\-Dst}.



 A BFC message destination contains information to direct a message from the sender to receiver, ie the destination. The BFC command path is a full-duplex, synchronous, many-to-one arrangement. Many applications can messages to a single command handler. The command handler serially handles each message and acknowledges this by returning the original message to the sender along with a disposition status code. Since this is a synchronous protocol, the sender is blocked until the message is returned or a timeout occurs.

The message stuff is strictly not part of the Run Control, but finds its must usage there. This stuff should really be split off to its own facility, but there is no time at this point. \hypertarget{BFC_8c_a3}{
\index{BFC.c@{BFC.c}!BFC_rto@{BFC\_\-rto}}
\index{BFC_rto@{BFC\_\-rto}!BFC.c@{BFC.c}}
\subsubsection[BFC\_\-rto]{\setlength{\rightskip}{0pt plus 5cm}BFC\_\-rto}}
\label{BFC_8c_a3}


Typedef for struct \hyperlink{struct__BFC__rto}{\_\-BFC\_\-rto}.



 When a run expires on a time limit, a watchdog timer is activated. This ISR routine merely sends the appropriate signal to the BFI group. \hypertarget{BFC_8c_a4}{
\index{BFC.c@{BFC.c}!BFC_setRtn@{BFC\_\-setRtn}}
\index{BFC_setRtn@{BFC\_\-setRtn}!BFC.c@{BFC.c}}
\subsubsection[BFC\_\-setRtn]{\setlength{\rightskip}{0pt plus 5cm}typedef int($\ast$ BFC\_\-set\-Rtn)(\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$rc, unsigned int value)}}
\label{BFC_8c_a4}


Typedef for generic set routine.

$\backslash$typdef BFC\_\-set\-Rtn 

 The call signature of the generic set routine is



\footnotesize\begin{verbatim}
      status = (*set) (BFC_runCtl *rc, int value);
  \end{verbatim}\normalsize 
 

\subsection{Function Documentation}
\hypertarget{BFC_8c_a5}{
\index{BFC.c@{BFC.c}!destroy@{destroy}}
\index{destroy@{destroy}!BFC.c@{BFC.c}}
\subsubsection[destroy]{\setlength{\rightskip}{0pt plus 5cm}int destroy (\hyperlink{BFC_8h_a2}{BFC\_\-run\-Ctl} $\ast$ {\em rc})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{BFC_8c_a5}


Returns all the resources associated with the run control block.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
rc}]The run control structure. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values: ]\par
\begin{description}
\item[{\em 
-1, always.}]This is {\bf not} a wind down routine. It is only a convenience routine used to return resources if the initialization sequence fails. \end{description}
\end{Desc}
\hypertarget{BFC_8c_a8}{
\index{BFC.c@{BFC.c}!msgInit@{msgInit}}
\index{msgInit@{msgInit}!BFC.c@{BFC.c}}
\subsubsection[msgInit]{\setlength{\rightskip}{0pt plus 5cm}void msg\-Init (void $\ast$ {\em unused}, void $\ast$ {\em msg}, int {\em size}, int {\em loff})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{BFC_8c_a8}


Initializes each packet as it is put on the free list.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
unused}]An unused user context parameter. \item[{\em 
msg}]The message packet to initialize \item[{\em 
size}]The size of the message packet \item[{\em 
loff}]The byte offset to the control links \end{description}
\end{Desc}
\hypertarget{BFC_8c_a7}{
\index{BFC.c@{BFC.c}!msgsInit@{msgsInit}}
\index{msgsInit@{msgsInit}!BFC.c@{BFC.c}}
\subsubsection[msgsInit]{\setlength{\rightskip}{0pt plus 5cm}FPA\_\-fcb $\ast$ msgs\-Init (int {\em nmsgs}, int {\em msg\-Size})\hspace{0.3cm}{\tt  \mbox{[}inline, static\mbox{]}}}}
\label{BFC_8c_a7}


Initializes a fixed packet pool to contain {\em nmsgs}.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
nmsgs}]The number of messages to place in the pool. \item[{\em 
msg\-Size}]The size, in bytes, of a single message. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns: ]\par
The handle of the newly created FPA pool. \end{Desc}
\hypertarget{BFC_8c_a9}{
\index{BFC.c@{BFC.c}!rtoRtn@{rtoRtn}}
\index{rtoRtn@{rtoRtn}!BFC.c@{BFC.c}}
\subsubsection[rtoRtn]{\setlength{\rightskip}{0pt plus 5cm}void rto\-Rtn (\hyperlink{BFC_8c_a3}{BFC\_\-rto} $\ast$ {\em rto})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{BFC_8c_a9}


Watchdog timer routine to signal the end of a run.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
rc}]The run control structure.\end{description}
\end{Desc}
This is the watchdog ISR routine to handle delivering an end of run due to time limit signal. \hypertarget{BFC_8c_a6}{
\index{BFC.c@{BFC.c}!runIsActive@{runIsActive}}
\index{runIsActive@{runIsActive}!BFC.c@{BFC.c}}
\subsubsection[runIsActive]{\setlength{\rightskip}{0pt plus 5cm}int run\-Is\-Active (\hyperlink{BFC_8h_a0}{BFC\_\-run\-State} {\em state})\hspace{0.3cm}{\tt  \mbox{[}inline, static\mbox{]}}}}
\label{BFC_8c_a6}


Indicates whether the specified run state occurs while a run is active.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
state}]The run state to test. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values: ]\par
\begin{description}
\item[{\em 
0, if}]the run state does not occur when a run is active \item[{\em 
!=0, if}]the run state does occur when a run is active. \end{description}
\end{Desc}
