Skip to content

Commit

Permalink
remove esp_random() as it is not supported on ESP8266
Browse files Browse the repository at this point in the history
  • Loading branch information
DedeHai committed May 6, 2024
1 parent a8ad5b1 commit 2458a85
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wled00/FX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8117,7 +8117,7 @@ uint16_t mode_particlefireworks(void)
currentspeed = speed;
counter = 0;
angleincrement = 2730 + random16(5461); // minimum 15° (=2730), + random(30°) (=5461)
angle = esp_random(); // random start angle
angle = random16(); // random start angle
speedvariation = angle & 0x01; // 0 or 1, no need for a new random number
// calculate the number of particles to make complete circles
percircle = (uint16_t)0xFFFF / angleincrement + 1;
Expand Down Expand Up @@ -8310,7 +8310,7 @@ uint16_t mode_particlefire(void)
{
if (!initParticleSystem(PartSys, 25, 4)) //maximum number of source (PS will determine the exact number based on segment size) and need 4 additional bytes for time keeping (uint32_t lastcall)
return mode_static(); // allocation failed; //allocation failed
SEGMENT.aux0 = esp_random(); // aux0 is wind position (index) in the perlin noise
SEGMENT.aux0 = random(); // aux0 is wind position (index) in the perlin noise
numFlames = PartSys->numSources;
DEBUG_PRINTF_P(PSTR("segment data ptr in fireFX %p\n"), SEGMENT.data);
}
Expand Down

0 comments on commit 2458a85

Please sign in to comment.