-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cpu/esp_common: use ESP-IDF random API for ESP32 #18277
cpu/esp_common: use ESP-IDF random API for ESP32 #18277
Conversation
cpu/esp_common/periph/hwrng.c
Outdated
} | ||
|
||
#if defined(MCU_ESP8266) || !defined(ESP32_USE_ESP_IDF_RANDOM) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#if defined(MCU_ESP8266) || !defined(ESP32_USE_ESP_IDF_RANDOM) | |
#if !IS_USED(ESP32_USE_ESP_IDF_RANDOM) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or just split the file between esp32 and esp8266 if that's possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I can move old implementation to cpu/esp8266
and remove it in cpu/esp32
. There is no reason to enable the old implementation for ESP32 because the new implementation is better because it works for all ESP32x SoC variants and gives better entropy. It is easy to split it. May I squash the split directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you provide a ESP32_USE_ESP_IDF_RANDOM
define we might as well use it to allow switching to the 'old' implementation if desired. Since it's already unset for the esp8266 case we don't need to check for it twice.
Apart for the nitpick ACK, just squash directly
6d1b39e
to
02310b1
Compare
The usual false positive due to mismatching checksums of an unrelated build (not even an ESP32 or ESP8266 board) |
Contribution description
This PR is a split-off from PR #17841 and provides the changes to use the ESP-IDF random API for
periph/hwrng
. This RNG uses the noise in the RF system of the WiFi or the BT interface as entropy source. If neither WiFi nor BT are used, an internal non-RF entropy source is used, the internal reference voltage noise.Testing procedure
Compile and test
Issues/PRs references
Split-off from PR #17841