Echelon Neuron C Instrukcja Użytkownika Strona 106

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 267
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 105
86 Functions
Example
void f(void)
{
unsigned int start, delta;
start = get_tick_count();
...
delta = get_tick_count() - start;
}
go_offline( ) Function
The go_offline( ) function takes an application offline. This function call has the
same effect on the device as receiving an
Offline
network management message.
The offline request takes effect as soon as the task that called go_offline( ) exits.
When that task exits, the when(offline) task is executed and the application
stops.
When an
Online
network management message is received, the when(online)
task is executed and the application resumes execution.
When an application goes offline, all outstanding transactions are terminated.
To ensure that any outstanding transactions complete normally, the application
can call flush_wait( ) in the when(offline) task.
Syntax
#include <control.h>
void go_offline (void);
Example
boolean maintenanceMode;
...
when (maintenanceMode)
{
go_offline();
}
when (offline)
{
// process shut-down command
flush_wait();
io_out(maintenanceLed, 0);
}
when (online) {
...
// re-start suspended operation, I/O devices,
// interrupts, etc
io_out(maintenanceLed, 1);
}
Przeglądanie stron 105
1 2 ... 101 102 103 104 105 106 107 108 109 110 111 ... 266 267

Komentarze do niniejszej Instrukcji

Brak uwag