Echelon Neuron C Manual do Utilizador Página 143

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 267
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 142
Neuron C Reference Guide 123
Example
void f(void)
{
unsigned value;
...
value = random();
}
resp_alloc( ) Built-in Function
The resp_alloc( ) built-in function allocates an object for an outgoing response.
The function returns TRUE if a resp_out object can be allocated. The function
returns FALSE if a resp_out object cannot be allocated. When this function
returns FALSE, a program can continue with other processing, if necessary,
rather than waiting for a free message buffer.
See Chapter 6,
How Devices Communicate Using Application Messages,
in the
Neuron C Programmer's Guide
for more information about application messages.
Syntax
boolean resp_alloc (void);
Example
when (...)
{
if (resp_alloc()) {
// OK. Build and send message
...
}
}
resp_cancel( ) Built-in Function
The resp_cancel( ) built-in function cancels the response being built and frees the
associated resp_out object, allowing another response to be constructed.
If a response is constructed but not sent before the critical section (for example, a
task) is exited, the response is automatically cancelled. See Chapter 6,
How
Devices Communicate Using Application Messages,
of the
Neuron C
Programmer's Guide
for more information.
Syntax
void
resp_cancel (void);
Example
void f(void)
{
if (resp_alloc()) {
...
Vista de página 142
1 2 ... 138 139 140 141 142 143 144 145 146 147 148 ... 266 267

Comentários a estes Manuais

Sem comentários