Echelon Neuron C Manual do Utilizador Página 140

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 267
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 139
120 Functions
when (nv_update_occurs(nviZone))
{
// New value of nviZone arrived
}
post_events( ) Function
The post_events( ) function defines a boundary of a critical section at which
network variable updates and messages are sent and incoming network variable
update and message events are posted.
The post_events( ) function is called implicitly by the scheduler at the end of
every task body. If the application program calls post_events( ) explicitly, the
application should be prepared to handle the special events online, offline, and
wink before checking for any msg_arrives event.
The post_events( ) function can also be used to improve network performance.
See
The
post_events
( )
Function
in Chapter 7,
Additional Features,
of the
Neuron C Programmer's Guide
for a more detailed discussion of this feature.
Syntax
#include <control.h>
void post_events (void);
Example
boolean still_processing;
...
void f(void)
{
while (still_processing) {
post_events();
...
}
}
power_up( ) Function
The power_up( ) function returns TRUE if the last reset resulted from a power-
up. Any time an application starts up (whether from a reset or from a power-up),
the when(reset) task runs, and you can use this function to determine whether
the start-up resulted from a power-up.
Syntax
#include <status.h>
boolean power_up (void);
Example
when (reset)
{
Vista de página 139
1 2 ... 135 136 137 138 139 140 141 142 143 144 145 ... 266 267

Comentários a estes Manuais

Sem comentários