mirror of
https://github.com/espressif/openthread.git
synced 2026-08-01 00:27:47 +00:00
[cc2538] fix radio disabled for entropy get (#3872)
Restore RFCORE_XREG_FRMCTRL0 after generating random values.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user