Algorithm improvement for timer based random number generator
Algorithm improvement for timer based random number generator

The timer based pseudo random number generator returns the
number of system clock ticks. If the random number function is
called subsequently in a time less than a system clock tick, it
leads to getting same number.

To prevent this the counter is introduced. Counter gets changed
each call, so it ensures the caller gets different numbers each time
the random number function gets called.

Change-Id: Ibe57e1e7a23909b185623af8dbb7e80647c7ee08
Signed-off-by: Dmitriy Korovkin <236c6d6726c42916ff3b3577f1e4a2ded1fbf8fe@windriver.com>

explora26/zephyr,erwango/zephyr,Vudentz/zephyr,tidyjiang8/zephyr-doc,runchip/zephyr-cc3220,Vudentz/zephyr,rsalveti/zephyr,nashif/zephyr,sharronliu/zephyr,zephyrproject-rtos/zephyr,aceofall/zephyr-iotos,jamesonwilliams/zephyr-kernel,aceofall/zephyr-iotos,explora26/zephyr,erwango/zephyr,holtmann/zephyr,zephyriot/zephyr,ldts/zephyr,fractalclone/zephyr-riscv,finikorg/zephyr,GiulianoFranchetto/zephyr,fractalclone/zephyr-riscv,sharronliu/zephyr,32bitmicro/zephyr,rsalveti/zephyr,zephyriot/zephyr,mirzak/zephyr-os,bigdinotech/zephyr,mbolivar/zephyr,coldnew/zephyr-project-fork,bigdinotech/zephyr,galak/zephyr,runchip/zephyr-cc3220,nashif/zephyr,jamesonwilliams/zephyr-kernel,tidyjiang8/zephyr-doc,mirzak/zephyr-os,bboozzoo/zephyr,ldts/zephyr,galak/zephyr,holtmann/zephyr,nashif/zephyr,runchip/zephyr-cc3200,Vudentz/zephyr,fbsder/zephyr,pklazy/zephyr,fractalclone/zephyr-riscv,sharronliu/zephyr,Vudentz/zephyr,kraj/zephyr,runchip/zephyr-cc3200,mirzak/zephyr-os,explora26/zephyr,fbsder/zephyr,coldnew/zephyr-project-fork,fbsder/zephyr,mbolivar/zephyr,fbsder/zephyr,rsalveti/zephyr,32bitmicro/zephyr,punitvara/zephyr,erwango/zephyr,tidyjiang8/zephyr-doc,mbolivar/zephyr,explora26/zephyr,Vudentz/zephyr,rsalveti/zephyr,ldts/zephyr,runchip/zephyr-cc3220,sharronliu/zephyr,bigdinotech/zephyr,explora26/zephyr,coldnew/zephyr-project-fork,kraj/zephyr,bboozzoo/zephyr,aceofall/zephyr-iotos,zephyriot/zephyr,pklazy/zephyr,kraj/zephyr,32bitmicro/zephyr,coldnew/zephyr-project-fork,galak/zephyr,punitvara/zephyr,jamesonwilliams/zephyr-kernel,Vudentz/zephyr,fractalclone/zephyr-riscv,aceofall/zephyr-iotos,mbolivar/zephyr,ldts/zephyr,mirzak/zephyr-os,runchip/zephyr-cc3220,zephyriot/zephyr,erwango/zephyr,fbsder/zephyr,nashif/zephyr,GiulianoFranchetto/zephyr,bboozzoo/zephyr,jamesonwilliams/zephyr-kernel,fractalclone/zephyr-riscv,nashif/zephyr,punitvara/zephyr,pklazy/zephyr,runchip/zephyr-cc3200,zephyriot/zephyr,bboozzoo/zephyr,rsalveti/zephyr,tidyjiang8/zephyr-doc,mbolivar/zephyr,finikorg/zephyr,punitvara/zephyr,GiulianoFranchetto/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr,holtmann/zephyr,pklazy/zephyr,32bitmicro/zephyr,finikorg/zephyr,mirzak/zephyr-os,runchip/zephyr-cc3200,GiulianoFranchetto/zephyr,finikorg/zephyr,bigdinotech/zephyr,bboozzoo/zephyr,galak/zephyr,GiulianoFranchetto/zephyr,galak/zephyr,erwango/zephyr,bigdinotech/zephyr,holtmann/zephyr,jamesonwilliams/zephyr-kernel,sharronliu/zephyr,kraj/zephyr,runchip/zephyr-cc3200,zephyrproject-rtos/zephyr,kraj/zephyr,pklazy/zephyr,runchip/zephyr-cc3220,ldts/zephyr,zephyrproject-rtos/zephyr,coldnew/zephyr-project-fork,aceofall/zephyr-iotos,holtmann/zephyr,zephyrproject-rtos/zephyr,32bitmicro/zephyr,tidyjiang8/zephyr-doc,punitvara/zephyr