瀏覽代碼

Fix EventResponder append to triggered list

teensy4-core
PaulStoffregen 7 年之前
父節點
當前提交
aa5e833b04
共有 2 個檔案被更改,包括 8 行新增2 行删除
  1. +2
    -0
      teensy3/EventResponder.cpp
  2. +6
    -2
      teensy3/EventResponder.h

+ 2
- 0
teensy3/EventResponder.cpp 查看文件

@@ -57,6 +57,7 @@ void EventResponder::triggerEventNotImmediate()
} else {
_next = nullptr;
_prev = lastYield;
_prev->_next = this;
lastYield = this;
}
} else if (_type == EventTypeInterrupt) {
@@ -69,6 +70,7 @@ void EventResponder::triggerEventNotImmediate()
} else {
_next = nullptr;
_prev = lastInterrupt;
_prev->_next = this;
lastInterrupt = this;
}
// TODO set interrupt pending

+ 6
- 2
teensy3/EventResponder.h 查看文件

@@ -27,7 +27,7 @@
* programs you write now using EventResponder may need to be
* updated as EventResponder develops.
*
* Please post EventResponder post your feedback here:
* Please post your EventResponder feedback here:
* https://forum.pjrc.com/threads/44723-Arduino-Events
*/

@@ -153,7 +153,11 @@ public:
if (first && !runningFromYield) {
runningFromYield = true;
firstYield = first->_next;
if (firstYield) firstYield->_prev = nullptr;
if (firstYield) {
firstYield->_prev = nullptr;
} else {
lastYield = nullptr;
}
first->_pending = false;
(*(first->_function))(*first);
runningFromYield = false;

Loading…
取消
儲存