1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

tests/periph/hwrng: LIMIT -> NUM_BYTES

This commit is contained in:
Benjamin Valentin 2024-05-29 14:20:49 +02:00
parent f42386587d
commit 4ff877d239

View File

@ -24,22 +24,22 @@
#include "xtimer.h" #include "xtimer.h"
#include "periph/hwrng.h" #include "periph/hwrng.h"
#define LIMIT (20U) #define NUM_BYTES (20U)
int main(void) int main(void)
{ {
uint8_t buf[LIMIT]; uint8_t buf[NUM_BYTES];
puts("\nHWRNG peripheral driver test\n"); puts("\nHWRNG peripheral driver test\n");
printf("This test will print from 1 to %u random bytes about every " printf("This test will print from 1 to %u random bytes about every "
"second\n\n", LIMIT); "second\n\n", NUM_BYTES);
while (1) { while (1) {
/* zero out buffer */ /* zero out buffer */
memset(buf, 0, sizeof(buf)); memset(buf, 0, sizeof(buf));
/* create random numbers */ /* create random numbers */
for (unsigned i = 1; i <= LIMIT; i++) { for (unsigned i = 1; i <= NUM_BYTES; i++) {
printf("generating %u random byte(s)\n", i); printf("generating %u random byte(s)\n", i);
hwrng_read(buf, i); hwrng_read(buf, i);