Explorar el Código

Fix EventResponder append to triggered list

teensy4-core
PaulStoffregen hace 7 años
padre
commit
aa5e833b04
Se han modificado 2 ficheros con 8 adiciones y 2 borrados
  1. +2
    -0
      teensy3/EventResponder.cpp
  2. +6
    -2
      teensy3/EventResponder.h

+ 2
- 0
teensy3/EventResponder.cpp Ver fichero

@@ -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 Ver fichero

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

Cargando…
Cancelar
Guardar