Kaynağa Gözat

Event Responder - fix _ms when adding items

When the run time issue adds an item back in to the list, it adds the item at the appropriate time, however it does not decrease the time of the item after where it was to take in account how much time the new item will take before we that next item starts to process it's _ms time
main
Kurt Eckhardt 7 yıl önce
ebeveyn
işleme
a8f0ab474f
1 değiştirilmiş dosya ile 3 ekleme ve 0 silme
  1. +3
    -0
      teensy3/EventResponder.cpp

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

@@ -225,6 +225,8 @@ void MillisTimer::addToActiveList() // only called by runFromTimer()
_next = listActive;
_prev = nullptr;
listActive->_prev = this;
// Decrement the next items wait time be our wait time as to properly handle waits for all other items...
listActive->_ms -= _ms;
listActive = this;
} else {
// add this timer somewhere after the first already on the list
@@ -238,6 +240,7 @@ void MillisTimer::addToActiveList() // only called by runFromTimer()
_prev = timer->_prev;
timer->_prev = this;
_prev->_next = this;
timer->_ms -= _ms;
_state = TimerActive;
return;
}

Yükleniyor…
İptal
Kaydet