Flush_cancel( ) function, Syntax, Example – Echelon Neuron C User Manual

Page 103: Flush_wait( ) function

Advertising
background image

Neuron C Reference Guide

83

when (flush_completes)
{
// Go to sleep
nothing_to_do = FALSE;
sleep();
}

flush_cancel( )

Function

The flush_cancel( ) function cancels a flush in progress.

Syntax

#include <control.h>

void flush_cancel (void);

Example

boolean nothing_to_do;
...
when (nv_update_occurs)
{
if (nothing_to_do) {
// was getting ready to sleep but received an input NV
nothing_to_do = FALSE;
flush_cancel();
}
}

flush_wait( )

Function

The flush_wait( ) function causes an application program to enter preemption

mode, during which all outstanding network variable and message transactions
are completed. When a program switches from asynchronous to direct event

processing, flush_wait( ) is used to ensure that all pending asynchronous

transactions are completed before direct event processing begins.

During preemption mode, only pending completion events (for example,

msg_completes or nv_update_fails) and pending response events (for example,

resp_arrives or nv_update_occurs) are processed. When this processing is
complete, flush_wait( ) returns. The application program can now process

network variables and messages directly and need not concern itself with

outstanding completion events and responses from earlier transactions.

Syntax

#include <control.h>

void flush_wait (void);

Example

msg_tag TAG1;
network output SNVT_volt nvoVoltage;

Advertising