We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 99b49fe commit dd226caCopy full SHA for dd226ca
hal/nrf5340.c
@@ -211,14 +211,16 @@ int hal_trng_get_entropy(unsigned char *out, unsigned int len)
211
unsigned int i = 0;
212
213
while (i < len) {
214
- while (!((CC_RNG_ISR & 0x01) && (CC_RNG_TRNG_VALID & 0x01))) {}
215
-
216
uint32_t data[6];
217
uint8_t *data_bytes = (uint8_t *)data;
218
- for (unsigned int word = 0; word < 6; word++) {
+ unsigned int word, byte;
+
+ while (!((CC_RNG_ISR & 0x01) && (CC_RNG_TRNG_VALID & 0x01))) {}
219
220
+ for (word = 0; word < 6; word++) {
221
data[word] = CC_RNG_EHR_DATA(word);
222
}
- for (unsigned int byte = 0; byte < 24 && i < len; byte++) {
223
+ for (byte = 0; byte < 24 && i < len; byte++) {
224
out[i++] = (unsigned char)data_bytes[byte];
225
226
0 commit comments