LFSRSeedRand Function

Microchip TCP/IP Stack

Microchip TCP/IP Stack Help
LFSRSeedRand Function
C
DWORD LFSRSeedRand(
    DWORD dwSeed
);
Description

Seeds the LFSR random number generator invoked by the LFSRRand() function. The prior seed is returned.

Preconditions

None

Parameters
Parameters 
Description 
wSeed 
The new 32-bit seed value to assign to the LFSR. 
Returns

The last seed in use. This can be saved and restored by a subsequent call to LFSRSeedRand() if you wish to use LFSRRand() in multiple contexts without disrupting the random number sequence from the alternative context. For example, if App 1 needs a given sequence of random numbers to perform a test, if you save and restore the seed in App 2, it is possible for App 2 to not disrupt the random number sequence provided to App 1, even if the number of times App 2 calls LFSRRand() varies.

Side Effects

None

Remarks

Upon initial power up, the internal seed is initialized to 0x1. Using a dwSeed value of 0x0 will return the same sequence of random numbers as using the seed of 0x1.

Microchip TCP/IP Stack 5.42.08 - June 15, 2013
Copyright © 2012 Microchip Technology, Inc.  All rights reserved.