Simple constexpr functions for compile-time corkscrew dimension calculation
| 49 | |
| 50 | // Simple constexpr functions for compile-time corkscrew dimension calculation |
| 51 | constexpr fl::u16 calculateCorkscrewWidth(float totalTurns, fl::u16 numLeds) { |
| 52 | return static_cast<fl::u16>(ceil_constexpr(static_cast<float>(numLeds) / totalTurns)); |
| 53 | } |
| 54 | |
| 55 | constexpr fl::u16 calculateCorkscrewHeight(float totalTurns, fl::u16 numLeds) { |
| 56 | return (calculateCorkscrewWidth(totalTurns, numLeds) * static_cast<int>(ceil_constexpr(totalTurns)) > numLeds) ? |
no test coverage detected