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.
This commit is contained in:
Damian Schneider 2024-10-15 13:16:18 +02:00
parent a0e81da8c5
commit 44e28f96e0

View File

@ -7749,7 +7749,7 @@ uint16_t mode_2Doctopus() {
const int C_Y = (rows / 2) + ((SEGMENT.custom2 - 128)*rows)/255;
for (int x = 0; x < cols; x++) {
for (int y = 0; y < rows; y++) {
rMap[XY(x, y)].angle = 40.7436f * atan2f((y - C_Y), (x - C_X)); // avoid 128*atan2()/PI
rMap[XY(x, y)].angle = int(40.7436f * atan2f((y - C_Y), (x - C_X))); // avoid 128*atan2()/PI
rMap[XY(x, y)].radius = hypotf((x - C_X), (y - C_Y)) * mapp; //thanks Sutaburosu
}
}