(experimental) loop2 to get fresh audio just before drawing

* introducing usermod::loop2() - runs just before strip.service()
--> expecting to reduce lagging between audio and visual to an absolute minimum.
This commit is contained in:
Frank
2024-09-21 20:41:05 +02:00
parent e100a2d69a
commit f1088bb5c0
5 changed files with 22 additions and 1 deletions

View File

@@ -213,6 +213,19 @@ void WLED::loop()
handlePresets();
yield();
#if defined(_MoonModules_WLED_) && defined(WLEDMM_FASTPATH)
#ifdef WLED_DEBUG
unsigned long usermod2Millis = millis();
#endif
usermods.loop2();
#ifdef WLED_DEBUG
usermod2Millis = millis() - usermod2Millis;
avgUsermodMillis += usermod2Millis;
if (usermod2Millis > maxUsermodMillis) maxUsermodMillis = usermod2Millis;
#endif
yield();
#endif
#ifdef WLED_DEBUG
unsigned long stripMillis = millis();
#endif