| 488 | extern int noise_max; |
| 489 | |
| 490 | void CFastLED::countFPS(int nFrames) { |
| 491 | static int br = 0; |
| 492 | static fl::u32 lastframe = 0; // fl::millis(); |
| 493 | |
| 494 | if(br++ >= nFrames) { |
| 495 | fl::u32 now = fl::millis(); |
| 496 | now -= lastframe; |
| 497 | if(now == 0) { |
| 498 | now = 1; // prevent division by zero below |
| 499 | } |
| 500 | mNFPS = (br * 1000) / now; |
| 501 | br = 0; |
| 502 | lastframe = fl::millis(); |
| 503 | } |
| 504 | } |
| 505 | |
| 506 | void CFastLED::setMaxRefreshRate(fl::u16 refresh, bool constrain) { |
| 507 | if(constrain) { |