Skip to content

Commit 6a26944

Browse files
committed
Fix for Octopus on ESP32 C3
Apparently the C3 can not convert negative floats to uint8_t directly, casting it into an int first fixes it.
1 parent b536792 commit 6a26944

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

wled00/FX.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7610,7 +7610,7 @@ uint16_t mode_2Doctopus() {
76107610
const int C_Y = (rows / 2) + ((SEGMENT.custom2 - 128)*rows)/255;
76117611
for (int x = 0; x < cols; x++) {
76127612
for (int y = 0; y < rows; y++) {
7613-
rMap[XY(x, y)].angle = 40.7436f * atan2f((y - C_Y), (x - C_X)); // avoid 128*atan2()/PI
7613+
rMap[XY(x, y)].angle = int(40.7436f * atan2f((y - C_Y), (x - C_X))); // avoid 128*atan2()/PI
76147614
rMap[XY(x, y)].radius = hypotf((x - C_X), (y - C_Y)) * mapp; //thanks Sutaburosu
76157615
}
76167616
}

0 commit comments

Comments
 (0)