mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-10-17 10:17:45 -04:00
Remove deprecated macro (ipconfigRAND32) references (#781)
* Remove ipconfigRAND32 referances from demos * Fix license header
This commit is contained in:
parent
4629138a42
commit
07c7ba7aa9
17 changed files with 136 additions and 47 deletions
|
@ -298,12 +298,14 @@ static BaseType_t prvCreateTxData( char *cBuffer, uint32_t ulBufferLength )
|
|||
BaseType_t lCharactersToAdd, lCharacter;
|
||||
char cChar = '0';
|
||||
const BaseType_t lMinimumLength = 60;
|
||||
uint32_t ulRandomNumber;
|
||||
|
||||
/* Randomise the number of characters that will be sent in the echo
|
||||
request. */
|
||||
do
|
||||
{
|
||||
lCharactersToAdd = ipconfigRAND32() % ( ulBufferLength - 20UL );
|
||||
( void ) xApplicationGetRandomNumber( &ulRandomNumber );
|
||||
lCharactersToAdd = ulRandomNumber % ( ulBufferLength - 20UL );
|
||||
} while ( ( lCharactersToAdd == 0 ) || ( lCharactersToAdd < lMinimumLength ) ); /* Must be at least enough to add the unique text to the start of the string later. */
|
||||
|
||||
/* Fill the buffer. */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* FreeRTOS V202112.00
|
||||
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
|
@ -20,7 +20,7 @@
|
|||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* https://www.FreeRTOS.org
|
||||
* https://aws.amazon.com/freertos
|
||||
* https://github.com/FreeRTOS
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -300,6 +300,7 @@ static void prvMiscInitialisation( void )
|
|||
{
|
||||
time_t xTimeNow;
|
||||
uint32_t ulLoggingIPAddress;
|
||||
uint32_t ulRandomNumbers[ 4 ];
|
||||
|
||||
ulLoggingIPAddress = FreeRTOS_inet_addr_quick( configECHO_SERVER_ADDR0, configECHO_SERVER_ADDR1, configECHO_SERVER_ADDR2, configECHO_SERVER_ADDR3 );
|
||||
vLoggingInit( xLogToStdout, xLogToFile, xLogToUDP, ulLoggingIPAddress, configPRINT_PORT );
|
||||
|
@ -308,7 +309,16 @@ static void prvMiscInitialisation( void )
|
|||
time( &xTimeNow );
|
||||
FreeRTOS_debug_printf( ( "Seed for randomiser: %lu\r\n", xTimeNow ) );
|
||||
prvSRand( ( uint32_t ) xTimeNow );
|
||||
FreeRTOS_debug_printf( ( "Random numbers: %08X %08X %08X %08X\r\n", ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32() ) );
|
||||
|
||||
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 0 ] );
|
||||
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 1 ] );
|
||||
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 2 ] );
|
||||
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 3 ] );
|
||||
FreeRTOS_debug_printf( ( "Random numbers: %08X %08X %08X %08X\r\n",
|
||||
ulRandomNumbers[ 0 ],
|
||||
ulRandomNumbers[ 1 ],
|
||||
ulRandomNumbers[ 2 ],
|
||||
ulRandomNumbers[ 3 ] ) );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue