Merge pull request #416 from ourairquality/lmac-use-hwrand

Use hwrand for the sdk uses of rand, in particular with the NMI.
This commit is contained in:
Ruslan V. Uss 2017-07-24 16:16:30 +05:00 committed by GitHub
commit 1544768025
2 changed files with 8 additions and 2 deletions

View file

@ -10,8 +10,13 @@
#include <esp/wdev_regs.h>
#include <string.h>
/* Return a random 32-bit number */
uint32_t hwrand(void)
/* Return a random 32-bit number.
*
* This is also used as a substitute for rand() called from
* lmac.a:sdk_lmacTxFrame to avoid touching the newlib reent structures within
* the NMI and the NMI code needs to be in IRAM.
*/
uint32_t IRAM hwrand(void)
{
return WDEV.HWRNG;
}

View file

@ -419,6 +419,7 @@ ram_set_txbb_atten sdk_ram_set_txbb_atten
ram_start_noisefloor sdk_ram_start_noisefloor
ram_tx_mac_disable sdk_ram_tx_mac_disable
ram_tx_mac_enable sdk_ram_tx_mac_enable
rand hwrand
rc4_skip sdk_rc4_skip
rcAttach sdk_rcAttach
rc_cal sdk_rc_cal