/* Function for generating a 32 bit random number using the internal random generator.  */
static uint32_t rnd32(void)
/* Function for generating a 32 bit random number using the internal random generator.  */
static uint32_t rnd32(void)
{
    uint8_t  i;
    uint32_t val = 0;
    for (i=0; i<4; i++)
    {
        val <<= 8;
        val  |= rnd8();
    }
    return val;
}