esp32: add some implementation comments

This commit is contained in:
Ivan Grokhotkov
2016-11-23 12:55:49 +08:00
parent df6edb50e9
commit 50f178c1ce
3 changed files with 32 additions and 0 deletions

View File

@@ -23,6 +23,14 @@
uint32_t IRAM_ATTR esp_random(void)
{
/* The PRNG which implements WDEV_RANDOM register gets 2 bits
* of extra entropy from a hardware randomness source every APB clock cycle.
* To make sure entropy is not drained faster than it is added,
* this function needs to wait for at least 16 APB clock cycles after reading
* previous word. This implementation may actually wait a bit longer
* due to extra time spent in arithmetic and branch statements.
*/
static uint32_t last_ccount = 0;
uint32_t ccount;
do {