Echelon Neuron C Instrukcja Użytkownika Strona 222

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 267
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 221
202 Built-In Variables, Objects, Symbols, and Semaphore
__lock { // acquire semaphore
f();
} // release semaphore
... // more unguarded code
}
This code results in a deadlock because the interrupt task owns the semaphore,
thus function f() can never succeed in acquiring it. The Neuron firmware resolves
the deadlock by resetting the chip after the watchdog timer expires, but you must
be sure to release the semaphore before acquiring it again.
Defining a lock with target hardware or firmware that does not support
semaphores yields a linker error, NLD#506.
If you define a lock for an interrupt task that runs within the application
processor, the Neuron Exporter issue a warning message (NEX#4014) that the
hardware semaphore and the __lock{ } statement are not operational for the
specified system clock setting. In addition, when the interrupt task runs, no
semaphore is acquired, access is granted immediately, but a system error is
logged.
Przeglądanie stron 221
1 2 ... 217 218 219 220 221 222 223 224 225 226 227 ... 266 267

Komentarze do niniejszej Instrukcji

Brak uwag