You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
558 B
27 lines
558 B
/* |
|
simple test of Random Number Generation |
|
*/ |
|
|
|
#include <AP_HAL/AP_HAL.h> |
|
|
|
void setup(); |
|
void loop(); |
|
|
|
const AP_HAL::HAL& hal = AP_HAL::get_HAL(); |
|
|
|
void setup(void) { |
|
hal.console->printf("Running Random Number Generator Test!\n"); |
|
} |
|
|
|
void loop(void) |
|
{ |
|
uint32_t random_number; |
|
if (hal.util->get_random_vals((uint8_t*)&random_number, sizeof(random_number))) { |
|
hal.console->printf("RNG %lx\n", (unsigned long)random_number); |
|
} else { |
|
hal.console->printf("RNG failed\n"); |
|
} |
|
hal.scheduler->delay(1000); |
|
} |
|
|
|
AP_HAL_MAIN(); |