ソースを参照

Add a couple more EventResponder comments

teensy4-core
PaulStoffregen 7年前
コミット
ea70a67f44
2個のファイルの変更14行の追加0行の削除
  1. +3
    -0
      teensy3/EventResponder.cpp
  2. +11
    -0
      teensy3/EventResponder.h

+ 3
- 0
teensy3/EventResponder.cpp ファイルの表示

@@ -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 ファイルの表示

@@ -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;

読み込み中…
キャンセル
保存