Skip to content

Commit 80061e8

Browse files
committed
Pinwheel: Use sin/cos16_t
1 parent e7e0eb0 commit 80061e8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

wled00/FX_fcn.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -694,8 +694,8 @@ static void setPinwheelParameters(int i, int vW, int vH, int& startx, int& start
694694
for (int k = 0; k < 2; k++) // angular steps for two consecutive rays
695695
{
696696
int angle = (i + k) * baseAngle + rotate;
697-
cosVal[k] = (cos16(angle) * Fixed_Scale) >> 15; // step per pixel in fixed point, cos16 output is -0x7FFF to +0x7FFF
698-
sinVal[k] = (sin16(angle) * Fixed_Scale) >> 15; // using explicit bit shifts as dividing negative numbers is not equivalent (rounding error is acceptable)
697+
cosVal[k] = (cos16_t(angle) * Fixed_Scale) >> 15; // step per pixel in fixed point, cos16 output is -0x7FFF to +0x7FFF
698+
sinVal[k] = (sin16_t(angle) * Fixed_Scale) >> 15; // using explicit bit shifts as dividing negative numbers is not equivalent (rounding error is acceptable)
699699
}
700700
startx = (vW * Fixed_Scale) / 2; // + cosVal[0] / 4; // starting position = center + 1/4 pixel (in fixed point)
701701
starty = (vH * Fixed_Scale) / 2; // + sinVal[0] / 4;

0 commit comments

Comments
 (0)