/* Function for generating an 8 bit random number using the internal random generator.  */
static uint32_t rnd8(void)
/* Function for generating an 8 bit random number using the internal random generator.  */
static uint32_t rnd8(void)
{
    NRF_RNG->EVENTS_VALRDY = 0;
    while (NRF_RNG->EVENTS_VALRDY == 0)
    {
    }
    return NRF_RNG->VALUE;
}