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
committed by Frank
parent a3545581ea
commit 4a3f102c25

View File

@@ -8410,7 +8410,7 @@ uint16_t mode_2Doctopus() {
const uint8_t C_Y = rows / 2 + (SEGMENT.custom2 - 128)*rows/255;
for (int x = xStart; x < xEnd; x++) {
for (int y = yStart; y < yEnd; 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
}
}