This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: TI C/C++ Compiler
Hello,
I am using #include "time.h" header file to get time_t t.
I have used srand((unsigned) time(&t)); to generate a random number which is random always when my code is not standalone. However, as soon as change it to standalone only the same number is generated. Is it possible a way to make that happen in Standalone mode as well?
Thanks,
Sagar Shah
The time RTS function, as supplied, only works when executing under control of CCS. If you want it to work outside of CCS, then you need to change the implementation.
Thanks and regards,
-George
Is there any other suggestions which I can use to generate random numbers in standalone mode?
One suggestion to consider: See if C2000Ware has a function, register, or something similar.
Thanks and regards,
-George
I'm not an expert on C2000Ware. But I guessed there would be some sort of timer available, and you could read the value of the timer through a register or function call. Then you would pass the value of this timer to srand.
Thanks and regards,
-George