diff --git a/examples/platforms/cc2538/entropy.c b/examples/platforms/cc2538/entropy.c index 6b6899049..2c50586e5 100644 --- a/examples/platforms/cc2538/entropy.c +++ b/examples/platforms/cc2538/entropy.c @@ -41,12 +41,15 @@ static void generateRandom(uint8_t *aOutput, uint16_t aOutputLength) { + uint32_t frmctrl0; + HWREG(SOC_ADC_ADCCON1) &= ~(SOC_ADC_ADCCON1_RCTRL1 | SOC_ADC_ADCCON1_RCTRL0); HWREG(SYS_CTRL_RCGCRFC) = SYS_CTRL_RCGCRFC_RFC0; while (HWREG(SYS_CTRL_RCGCRFC) != SYS_CTRL_RCGCRFC_RFC0) ; + frmctrl0 = HWREG(RFCORE_XREG_FRMCTRL0); HWREG(RFCORE_XREG_FRMCTRL0) = RFCORE_XREG_FRMCTRL0_INFINITY_RX; HWREG(RFCORE_SFR_RFST) = RFCORE_SFR_RFST_INSTR_RXON; @@ -64,7 +67,8 @@ static void generateRandom(uint8_t *aOutput, uint16_t aOutputLength) } } - HWREG(RFCORE_SFR_RFST) = RFCORE_SFR_RFST_INSTR_RFOFF; + HWREG(RFCORE_SFR_RFST) = RFCORE_SFR_RFST_INSTR_RFOFF; + HWREG(RFCORE_XREG_FRMCTRL0) = frmctrl0; } void cc2538RandomInit(void)