Kaynağa Gözat

Add a couple more EventResponder comments

teensy4-core
PaulStoffregen 7 yıl önce
ebeveyn
işleme
ea70a67f44
2 değiştirilmiş dosya ile 14 ekleme ve 0 silme
  1. +3
    -0
      teensy3/EventResponder.cpp
  2. +11
    -0
      teensy3/EventResponder.h

+ 3
- 0
teensy3/EventResponder.cpp Dosyayı Görüntüle

@@ -87,6 +87,9 @@ void pendablesrvreq_isr(void)

void EventResponder::runFromInterrupt()
{
// FIXME: this will fail if the handler function triggers
// its own or other EventResponder instances. The list will
// change while we're holding a pointers to it.
for (EventResponder *first=firstInterrupt; first; first = first->_next) {
first->_pending = false;
(*(first->_function))(*first);

+ 11
- 0
teensy3/EventResponder.h Dosyayı Görüntüle

@@ -47,6 +47,17 @@
* for the most immediate response, even if doing so is more difficult.
* EventResponder lets you choose how your function will be called,
* without editing the timers or libraries which trigger the events.
*
* Event handling functions called by EventResponder should complete
* their work quickly. Avoid delays or operations which may take
* substantial time. While your function runs, no other event functions
* (attached the same way) are able to run.
*
* If your EventResponder is triggered more than once before your
* function can run, only the last trigger is used. Prior triggering,
* including the status integer and data pointer, are overwritten and
* your function is called only one time, based on the last trigger
* event.
*/

class EventResponder;

Yükleniyor…
İptal
Kaydet