more accurate FPS forESP32

the standard millis() code is very inaccurate in the "high FPS" ranges. This replaces it with the esp32 high resolution timer.
This commit is contained in:
Frank
2023-04-21 17:34:01 +02:00
parent 9130e4be54
commit 8e9db0adde
3 changed files with 27 additions and 2 deletions

View File

@@ -2809,7 +2809,7 @@ uint16_t mode_bouncing_balls(void) {
// number of balls based on intensity setting to max of 7 (cycles colors)
// non-chosen color is a random color
uint16_t numBalls = (SEGMENT.intensity * (maxNumBalls - 1)) / 255 + 1; // minimum 1 ball
const float gravity = -9.81; // standard value of gravity
constexpr float gravity = -9.81; // standard value of gravity
const bool hasCol2 = SEGCOLOR(2);
const unsigned long time = millis();