Skip to content

Commit

Permalink
Remove call to randomSeed() (#2374)
Browse files Browse the repository at this point in the history
This function causes the new arduino-esp32 core to revert to the pseudorandom behavior specified in Arduino.
Calls to random() automatically use esp_random() if randomSeed or useRealRandomGenerator(false) aren't called.
Tentative fix for #2357
  • Loading branch information
code8buster authored Mar 23, 2023
1 parent 5cb1f96 commit 958d2cf
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/platform/esp32/main-esp32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ void esp32Setup()
{
uint32_t seed = esp_random();
LOG_DEBUG("Setting random seed %u\n", seed);
randomSeed(seed); // ESP docs say this is fairly random

LOG_DEBUG("Total heap: %d\n", ESP.getHeapSize());
LOG_DEBUG("Free heap: %d\n", ESP.getFreeHeap());
Expand Down Expand Up @@ -221,4 +220,4 @@ void cpuDeepSleep(uint64_t msecToWake)

esp_sleep_enable_timer_wakeup(msecToWake * 1000ULL); // call expects usecs
esp_deep_sleep_start(); // TBD mA sleep current (battery)
}
}

0 comments on commit 958d2cf

Please sign in to comment.