diff --git a/source/FreeRTOS_DNS_Cache.c b/source/FreeRTOS_DNS_Cache.c index 79342371ab..a25e46ef22 100644 --- a/source/FreeRTOS_DNS_Cache.c +++ b/source/FreeRTOS_DNS_Cache.c @@ -220,7 +220,7 @@ pxIP->xIPAddress.ulIP_IPv4 = 0U; } - ulCurrentTimeSeconds = ( uint32_t ) ( ( xCurrentTickCount / portTICK_PERIOD_MS ) / 1000U ); + ulCurrentTimeSeconds = ( uint32_t ) ( ( xCurrentTickCount / configTICK_RATE_HZ ) ); xResult = prvFindEntryIndex( pcName, pxIP, &uxIndex ); if( xResult == pdTRUE ) diff --git a/source/FreeRTOS_DNS_Callback.c b/source/FreeRTOS_DNS_Callback.c index 4bb4ad863f..e8ab97f883 100644 --- a/source/FreeRTOS_DNS_Callback.c +++ b/source/FreeRTOS_DNS_Callback.c @@ -125,7 +125,7 @@ * @param[in] pcHostName The hostname whose IP address is being searched for. * @param[in] pvSearchID The search ID of the DNS callback function to set. * @param[in] pCallbackFunction The callback function pointer. - * @param[in] uxTimeout Timeout of the callback function. + * @param[in] uxTimeout Timeout of the callback function in ms. * @param[in] uxIdentifier Random number used as ID in the DNS message. * @param[in] xIsIPv6 pdTRUE if the address type should be IPv6. */ @@ -145,7 +145,7 @@ DNSCallback_t * pxCallback = ( ( DNSCallback_t * ) pvPortMalloc( sizeof( *pxCallback ) + lLength ) ); /* Translate from ms to number of clock ticks. */ - uxTimeout /= portTICK_PERIOD_MS; + uxTimeout = pdMS_TO_TICKS( uxTimeout ); if( pxCallback != NULL ) { diff --git a/source/FreeRTOS_TCP_WIN.c b/source/FreeRTOS_TCP_WIN.c index 303fd22ea3..23182baf00 100644 --- a/source/FreeRTOS_TCP_WIN.c +++ b/source/FreeRTOS_TCP_WIN.c @@ -374,7 +374,7 @@ TickType_t uxNow = xTaskGetTickCount(); TickType_t uxDiff = uxNow - pxTimer->uxBorn; - return ( uint32_t ) ( uxDiff * portTICK_PERIOD_MS ); + return ( uint32_t ) pdTICKS_TO_MS( uxDiff ); } /*-----------------------------------------------------------*/ diff --git a/source/FreeRTOS_Tiny_TCP.c b/source/FreeRTOS_Tiny_TCP.c index 2778b7083b..e4d4b4dacb 100644 --- a/source/FreeRTOS_Tiny_TCP.c +++ b/source/FreeRTOS_Tiny_TCP.c @@ -124,7 +124,7 @@ TickType_t uxNow = xTaskGetTickCount(); TickType_t uxDiff = uxNow - pxTimer->uxBorn; - return uxDiff * portTICK_PERIOD_MS; + return pdTICKS_TO_MS( uxDiff ); } /*-----------------------------------------------------------*/ diff --git a/source/include/FreeRTOSIPConfigDefaults.h b/source/include/FreeRTOSIPConfigDefaults.h index e9d8a1c7b3..efdeb89840 100644 --- a/source/include/FreeRTOSIPConfigDefaults.h +++ b/source/include/FreeRTOSIPConfigDefaults.h @@ -308,7 +308,7 @@ * Type: TickType_t * Unit: milliseconds * Minimum: 0 - * Maximum: portMAX_DELAY * portTICK_PERIOD_MS + * Maximum: ( portMAX_DELAY / configTICK_RATE_HZ ) * 1000 * * Sets the timeout to wait for a response to a router * solicitation message. @@ -322,7 +322,7 @@ #error ipconfigRA_SEARCH_TIME_OUT_MSEC must be at least 0 #endif -STATIC_ASSERT( ipconfigRA_SEARCH_TIME_OUT_MSEC <= ( portMAX_DELAY * portTICK_PERIOD_MS ) ); +STATIC_ASSERT( pdMS_TO_TICKS( ipconfigRA_SEARCH_TIME_OUT_MSEC ) <= portMAX_DELAY ); /*---------------------------------------------------------------------------*/ @@ -357,7 +357,7 @@ STATIC_ASSERT( ipconfigRA_SEARCH_TIME_OUT_MSEC <= ( portMAX_DELAY * portTICK_PER * Type: TickType_t * Unit: milliseconds * Minimum: 0 - * Maximum: portMAX_DELAY * portTICK_PERIOD_MS + * Maximum: ( portMAX_DELAY / configTICK_RATE_HZ ) * 1000 * * Sets the timeout to wait for a response to a neighbour solicitation message. */ @@ -370,7 +370,7 @@ STATIC_ASSERT( ipconfigRA_SEARCH_TIME_OUT_MSEC <= ( portMAX_DELAY * portTICK_PER #error ipconfigRA_IP_TEST_TIME_OUT_MSEC must be at least 0 #endif -STATIC_ASSERT( ipconfigRA_IP_TEST_TIME_OUT_MSEC <= ( portMAX_DELAY * portTICK_PERIOD_MS ) ); +STATIC_ASSERT( pdMS_TO_TICKS( ipconfigRA_IP_TEST_TIME_OUT_MSEC ) <= portMAX_DELAY ); /*---------------------------------------------------------------------------*/ @@ -1726,8 +1726,7 @@ STATIC_ASSERT( ipconfigTCP_KEEP_ALIVE_INTERVAL <= ( portMAX_DELAY / configTICK_R * network buffers are themselves blocked waiting for a network buffer. * * ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in - * milliseconds can be converted to a time in ticks by dividing the time in - * milliseconds by portTICK_PERIOD_MS. + * milliseconds can be converted to a time in ticks using pdMS_TO_TICKS(). */ #ifndef ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS diff --git a/source/portable/NetworkInterface/SH2A/NetworkInterface.c b/source/portable/NetworkInterface/SH2A/NetworkInterface.c index 3225126227..627c5c8f9a 100644 --- a/source/portable/NetworkInterface/SH2A/NetworkInterface.c +++ b/source/portable/NetworkInterface/SH2A/NetworkInterface.c @@ -55,7 +55,7 @@ * task performing the transmit will block for niTX_BUFFER_FREE_WAIT * milliseconds. It will do this a maximum of niMAX_TX_ATTEMPTS before giving * up. */ -#define niTX_BUFFER_FREE_WAIT ( ( TickType_t ) 2UL / portTICK_PERIOD_MS ) +#define niTX_BUFFER_FREE_WAIT ( pdMS_TO_TICKS( 2UL ) ) #define niMAX_TX_ATTEMPTS ( 5 ) /* The length of the queue used to send interrupt status words from the diff --git a/test/Coverity/ConfigFiles/FreeRTOSIPConfig.h b/test/Coverity/ConfigFiles/FreeRTOSIPConfig.h index b37503cd79..c495280c5c 100644 --- a/test/Coverity/ConfigFiles/FreeRTOSIPConfig.h +++ b/test/Coverity/ConfigFiles/FreeRTOSIPConfig.h @@ -116,10 +116,9 @@ * maximum allowable send block time prevents prevents a deadlock occurring when * all the network buffers are in use and the tasks that process (and subsequently * free) the network buffers are themselves blocked waiting for a network buffer. - * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in - * milliseconds can be converted to a time in ticks by dividing the time in - * milliseconds by portTICK_PERIOD_MS. */ -#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS ( 5000U / portTICK_PERIOD_MS ) + * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in + * milliseconds can be converted to a time in ticks using pdMS_TO_TICKS().*/ +#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS pdMS_TO_TICKS( 5000U ) /* If ipconfigUSE_DHCP is 1 then FreeRTOS+TCP will attempt to retrieve an IP * address, netmask, DNS server address and gateway address from a DHCP server. If @@ -144,8 +143,7 @@ * static IP address passed as a parameter to FreeRTOS_IPInit() if the * re-transmission time interval reaches ipconfigMAXIMUM_DISCOVER_TX_PERIOD without * a DHCP reply being received. */ -#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD \ - ( 120000U / portTICK_PERIOD_MS ) +#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD pdMS_TO_TICKS( 120000U ) /* The ARP cache is a table that maps IP addresses to MAC addresses. The IP * stack can only send a UDP message to a remove IP address if it knowns the MAC @@ -156,19 +154,19 @@ * cache then the UDP message is replaced by a ARP message that solicits the * required MAC address information. ipconfigARP_CACHE_ENTRIES defines the maximum * number of entries that can exist in the ARP table at any one time. */ -#define ipconfigARP_CACHE_ENTRIES 6 +#define ipconfigARP_CACHE_ENTRIES 6 /* ARP requests that do not result in an ARP response will be re-transmitted a * maximum of ipconfigMAX_ARP_RETRANSMISSIONS times before the ARP request is * aborted. */ -#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) +#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) /* ipconfigMAX_ARP_AGE defines the maximum time between an entry in the ARP * table being created or refreshed and the entry being removed because it is stale. * New ARP requests are sent for ARP cache entries that are nearing their maximum * age. ipconfigMAX_ARP_AGE is specified in tens of seconds, so a value of 150 is * equal to 1500 seconds (or 25 minutes). */ -#define ipconfigMAX_ARP_AGE 150 +#define ipconfigMAX_ARP_AGE 150 /* Implementing FreeRTOS_inet_addr() necessitates the use of string handling * routines, which are relatively large. To save code space the full @@ -180,13 +178,13 @@ * ipconfigINCLUDE_FULL_INET_ADDR is set to 1 then both FreeRTOS_inet_addr() and * FreeRTOS_indet_addr_quick() are available. If ipconfigINCLUDE_FULL_INET_ADDR is * not set to 1 then only FreeRTOS_indet_addr_quick() is available. */ -#define ipconfigINCLUDE_FULL_INET_ADDR 1 +#define ipconfigINCLUDE_FULL_INET_ADDR 1 /* ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS defines the total number of network buffer that * are available to the IP stack. The total number of network buffers is limited * to ensure the total amount of RAM that can be consumed by the IP stack is capped * to a pre-determinable value. */ -#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60U +#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60U /* A FreeRTOS queue is used to send events from application tasks to the IP * stack. ipconfigEVENT_QUEUE_LENGTH sets the maximum number of events that can diff --git a/test/build-combination/AllDisable/FreeRTOSIPConfig.h b/test/build-combination/AllDisable/FreeRTOSIPConfig.h index ba46611a14..49dd7f1efa 100644 --- a/test/build-combination/AllDisable/FreeRTOSIPConfig.h +++ b/test/build-combination/AllDisable/FreeRTOSIPConfig.h @@ -112,10 +112,9 @@ * maximum allowable send block time prevents prevents a deadlock occurring when * all the network buffers are in use and the tasks that process (and subsequently * free) the network buffers are themselves blocked waiting for a network buffer. - * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in - * milliseconds can be converted to a time in ticks by dividing the time in - * milliseconds by portTICK_PERIOD_MS. */ -#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS ( 5000U / portTICK_PERIOD_MS ) + * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in + * milliseconds can be converted to a time in ticks using pdMS_TO_TICKS().*/ +#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS pdMS_TO_TICKS( 5000U ) /* If ipconfigUSE_DHCP is 1 then FreeRTOS+TCP will attempt to retrieve an IP * address, netmask, DNS server address and gateway address from a DHCP server. If diff --git a/test/build-combination/AllEnable/FreeRTOSIPConfig.h b/test/build-combination/AllEnable/FreeRTOSIPConfig.h index 44c7e8df91..02bd4615a4 100644 --- a/test/build-combination/AllEnable/FreeRTOSIPConfig.h +++ b/test/build-combination/AllEnable/FreeRTOSIPConfig.h @@ -143,10 +143,9 @@ * maximum allowable send block time prevents prevents a deadlock occurring when * all the network buffers are in use and the tasks that process (and subsequently * free) the network buffers are themselves blocked waiting for a network buffer. - * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in - * milliseconds can be converted to a time in ticks by dividing the time in - * milliseconds by portTICK_PERIOD_MS. */ -#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS ( 5000U / portTICK_PERIOD_MS ) + * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in + * milliseconds can be converted to a time in ticks using pdMS_TO_TICKS().*/ +#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS pdMS_TO_TICKS( 5000U ) /* If ipconfigUSE_DHCP is 1 then FreeRTOS+TCP will attempt to retrieve an IP * address, netmask, DNS server address and gateway address from a DHCP server. If @@ -171,8 +170,7 @@ * static IP address passed as a parameter to FreeRTOS_IPInit() if the * re-transmission time interval reaches ipconfigMAXIMUM_DISCOVER_TX_PERIOD without * a DHCP reply being received. */ -#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD \ - ( 120000U / portTICK_PERIOD_MS ) +#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD pdMS_TO_TICKS( 120000U ) /* The ARP cache is a table that maps IP addresses to MAC addresses. The IP * stack can only send a UDP message to a remove IP address if it knowns the MAC @@ -183,19 +181,19 @@ * cache then the UDP message is replaced by a ARP message that solicits the * required MAC address information. ipconfigARP_CACHE_ENTRIES defines the maximum * number of entries that can exist in the ARP table at any one time. */ -#define ipconfigARP_CACHE_ENTRIES 6 +#define ipconfigARP_CACHE_ENTRIES 6 /* ARP requests that do not result in an ARP response will be re-transmitted a * maximum of ipconfigMAX_ARP_RETRANSMISSIONS times before the ARP request is * aborted. */ -#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) +#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) /* ipconfigMAX_ARP_AGE defines the maximum time between an entry in the ARP * table being created or refreshed and the entry being removed because it is stale. * New ARP requests are sent for ARP cache entries that are nearing their maximum * age. ipconfigMAX_ARP_AGE is specified in tens of seconds, so a value of 150 is * equal to 1500 seconds (or 25 minutes). */ -#define ipconfigMAX_ARP_AGE 150 +#define ipconfigMAX_ARP_AGE 150 /* Implementing FreeRTOS_inet_addr() necessitates the use of string handling * routines, which are relatively large. To save code space the full @@ -207,13 +205,13 @@ * ipconfigINCLUDE_FULL_INET_ADDR is set to 1 then both FreeRTOS_inet_addr() and * FreeRTOS_indet_addr_quick() are available. If ipconfigINCLUDE_FULL_INET_ADDR is * not set to 1 then only FreeRTOS_indet_addr_quick() is available. */ -#define ipconfigINCLUDE_FULL_INET_ADDR 1 +#define ipconfigINCLUDE_FULL_INET_ADDR 1 /* ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS defines the total number of network buffer that * are available to the IP stack. The total number of network buffers is limited * to ensure the total amount of RAM that can be consumed by the IP stack is capped * to a pre-determinable value. */ -#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 +#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 /* A FreeRTOS queue is used to send events from application tasks to the IP * stack. ipconfigEVENT_QUEUE_LENGTH sets the maximum number of events that can @@ -287,7 +285,7 @@ /* The windows simulator cannot really simulate MAC interrupts, and needs to * block occasionally to allow other tasks to run. */ -#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY ( 20 / portTICK_PERIOD_MS ) +#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY pdMS_TO_TICKS( 20 ) /* Advanced only: in order to access 32-bit fields in the IP packets with * 32-bit memory instructions, all packets will be stored 32-bit-aligned, diff --git a/test/build-combination/Enable_IPv4/FreeRTOSIPConfig.h b/test/build-combination/Enable_IPv4/FreeRTOSIPConfig.h index b610106031..10ce16ba2d 100644 --- a/test/build-combination/Enable_IPv4/FreeRTOSIPConfig.h +++ b/test/build-combination/Enable_IPv4/FreeRTOSIPConfig.h @@ -146,10 +146,9 @@ * maximum allowable send block time prevents prevents a deadlock occurring when * all the network buffers are in use and the tasks that process (and subsequently * free) the network buffers are themselves blocked waiting for a network buffer. - * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in - * milliseconds can be converted to a time in ticks by dividing the time in - * milliseconds by portTICK_PERIOD_MS. */ -#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS ( 5000U / portTICK_PERIOD_MS ) + * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in + * milliseconds can be converted to a time in ticks using pdMS_TO_TICKS().*/ +#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS pdMS_TO_TICKS( 5000U ) /* If ipconfigUSE_DHCP is 1 then FreeRTOS+TCP will attempt to retrieve an IP * address, netmask, DNS server address and gateway address from a DHCP server. If @@ -174,8 +173,7 @@ * static IP address passed as a parameter to FreeRTOS_IPInit() if the * re-transmission time interval reaches ipconfigMAXIMUM_DISCOVER_TX_PERIOD without * a DHCP reply being received. */ -#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD \ - ( 120000U / portTICK_PERIOD_MS ) +#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD pdMS_TO_TICKS( 120000U ) /* The ARP cache is a table that maps IP addresses to MAC addresses. The IP * stack can only send a UDP message to a remove IP address if it knowns the MAC @@ -186,19 +184,19 @@ * cache then the UDP message is replaced by a ARP message that solicits the * required MAC address information. ipconfigARP_CACHE_ENTRIES defines the maximum * number of entries that can exist in the ARP table at any one time. */ -#define ipconfigARP_CACHE_ENTRIES 6 +#define ipconfigARP_CACHE_ENTRIES 6 /* ARP requests that do not result in an ARP response will be re-transmitted a * maximum of ipconfigMAX_ARP_RETRANSMISSIONS times before the ARP request is * aborted. */ -#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) +#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) /* ipconfigMAX_ARP_AGE defines the maximum time between an entry in the ARP * table being created or refreshed and the entry being removed because it is stale. * New ARP requests are sent for ARP cache entries that are nearing their maximum * age. ipconfigMAX_ARP_AGE is specified in tens of seconds, so a value of 150 is * equal to 1500 seconds (or 25 minutes). */ -#define ipconfigMAX_ARP_AGE 150 +#define ipconfigMAX_ARP_AGE 150 /* Implementing FreeRTOS_inet_addr() necessitates the use of string handling * routines, which are relatively large. To save code space the full @@ -210,13 +208,13 @@ * ipconfigINCLUDE_FULL_INET_ADDR is set to 1 then both FreeRTOS_inet_addr() and * FreeRTOS_indet_addr_quick() are available. If ipconfigINCLUDE_FULL_INET_ADDR is * not set to 1 then only FreeRTOS_indet_addr_quick() is available. */ -#define ipconfigINCLUDE_FULL_INET_ADDR 1 +#define ipconfigINCLUDE_FULL_INET_ADDR 1 /* ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS defines the total number of network buffer that * are available to the IP stack. The total number of network buffers is limited * to ensure the total amount of RAM that can be consumed by the IP stack is capped * to a pre-determinable value. */ -#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 +#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 /* A FreeRTOS queue is used to send events from application tasks to the IP * stack. ipconfigEVENT_QUEUE_LENGTH sets the maximum number of events that can @@ -290,7 +288,7 @@ /* The windows simulator cannot really simulate MAC interrupts, and needs to * block occasionally to allow other tasks to run. */ -#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY ( 20 / portTICK_PERIOD_MS ) +#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY pdMS_TO_TICKS( 20 ) /* Advanced only: in order to access 32-bit fields in the IP packets with * 32-bit memory instructions, all packets will be stored 32-bit-aligned, diff --git a/test/build-combination/Enable_IPv4_IPv6/FreeRTOSIPConfig.h b/test/build-combination/Enable_IPv4_IPv6/FreeRTOSIPConfig.h index 3c7b30e67b..7a94a71d43 100644 --- a/test/build-combination/Enable_IPv4_IPv6/FreeRTOSIPConfig.h +++ b/test/build-combination/Enable_IPv4_IPv6/FreeRTOSIPConfig.h @@ -290,7 +290,7 @@ /* The windows simulator cannot really simulate MAC interrupts, and needs to * block occasionally to allow other tasks to run. */ -#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY ( 20 / portTICK_PERIOD_MS ) +#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY pdMS_TO_TICKS( 20 ) /* Advanced only: in order to access 32-bit fields in the IP packets with * 32-bit memory instructions, all packets will be stored 32-bit-aligned, diff --git a/test/build-combination/Enable_IPv4_TCP/FreeRTOSIPConfig.h b/test/build-combination/Enable_IPv4_TCP/FreeRTOSIPConfig.h index eea9281f20..6c398206b0 100644 --- a/test/build-combination/Enable_IPv4_TCP/FreeRTOSIPConfig.h +++ b/test/build-combination/Enable_IPv4_TCP/FreeRTOSIPConfig.h @@ -146,10 +146,9 @@ * maximum allowable send block time prevents prevents a deadlock occurring when * all the network buffers are in use and the tasks that process (and subsequently * free) the network buffers are themselves blocked waiting for a network buffer. - * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in - * milliseconds can be converted to a time in ticks by dividing the time in - * milliseconds by portTICK_PERIOD_MS. */ -#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS ( 5000U / portTICK_PERIOD_MS ) + * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in + * milliseconds can be converted to a time in ticks using pdMS_TO_TICKS().*/ +#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS pdMS_TO_TICKS( 5000U ) /* If ipconfigUSE_DHCP is 1 then FreeRTOS+TCP will attempt to retrieve an IP * address, netmask, DNS server address and gateway address from a DHCP server. If @@ -174,8 +173,7 @@ * static IP address passed as a parameter to FreeRTOS_IPInit() if the * re-transmission time interval reaches ipconfigMAXIMUM_DISCOVER_TX_PERIOD without * a DHCP reply being received. */ -#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD \ - ( 120000U / portTICK_PERIOD_MS ) +#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD pdMS_TO_TICKS( 120000U ) /* The ARP cache is a table that maps IP addresses to MAC addresses. The IP * stack can only send a UDP message to a remove IP address if it knowns the MAC @@ -186,19 +184,19 @@ * cache then the UDP message is replaced by a ARP message that solicits the * required MAC address information. ipconfigARP_CACHE_ENTRIES defines the maximum * number of entries that can exist in the ARP table at any one time. */ -#define ipconfigARP_CACHE_ENTRIES 6 +#define ipconfigARP_CACHE_ENTRIES 6 /* ARP requests that do not result in an ARP response will be re-transmitted a * maximum of ipconfigMAX_ARP_RETRANSMISSIONS times before the ARP request is * aborted. */ -#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) +#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) /* ipconfigMAX_ARP_AGE defines the maximum time between an entry in the ARP * table being created or refreshed and the entry being removed because it is stale. * New ARP requests are sent for ARP cache entries that are nearing their maximum * age. ipconfigMAX_ARP_AGE is specified in tens of seconds, so a value of 150 is * equal to 1500 seconds (or 25 minutes). */ -#define ipconfigMAX_ARP_AGE 150 +#define ipconfigMAX_ARP_AGE 150 /* Implementing FreeRTOS_inet_addr() necessitates the use of string handling * routines, which are relatively large. To save code space the full @@ -210,13 +208,13 @@ * ipconfigINCLUDE_FULL_INET_ADDR is set to 1 then both FreeRTOS_inet_addr() and * FreeRTOS_indet_addr_quick() are available. If ipconfigINCLUDE_FULL_INET_ADDR is * not set to 1 then only FreeRTOS_indet_addr_quick() is available. */ -#define ipconfigINCLUDE_FULL_INET_ADDR 1 +#define ipconfigINCLUDE_FULL_INET_ADDR 1 /* ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS defines the total number of network buffer that * are available to the IP stack. The total number of network buffers is limited * to ensure the total amount of RAM that can be consumed by the IP stack is capped * to a pre-determinable value. */ -#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 +#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 /* A FreeRTOS queue is used to send events from application tasks to the IP * stack. ipconfigEVENT_QUEUE_LENGTH sets the maximum number of events that can diff --git a/test/build-combination/Enable_IPv6/FreeRTOSIPConfig.h b/test/build-combination/Enable_IPv6/FreeRTOSIPConfig.h index 0bf7c1def1..276cecbfda 100644 --- a/test/build-combination/Enable_IPv6/FreeRTOSIPConfig.h +++ b/test/build-combination/Enable_IPv6/FreeRTOSIPConfig.h @@ -174,8 +174,7 @@ * static IP address passed as a parameter to FreeRTOS_IPInit() if the * re-transmission time interval reaches ipconfigMAXIMUM_DISCOVER_TX_PERIOD without * a DHCP reply being received. */ -#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD \ - ( 120000U / portTICK_PERIOD_MS ) +#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD pdMS_TO_TICKS( 120000U ) /* The ARP cache is a table that maps IP addresses to MAC addresses. The IP * stack can only send a UDP message to a remove IP address if it knowns the MAC @@ -186,19 +185,19 @@ * cache then the UDP message is replaced by a ARP message that solicits the * required MAC address information. ipconfigARP_CACHE_ENTRIES defines the maximum * number of entries that can exist in the ARP table at any one time. */ -#define ipconfigARP_CACHE_ENTRIES 6 +#define ipconfigARP_CACHE_ENTRIES 6 /* ARP requests that do not result in an ARP response will be re-transmitted a * maximum of ipconfigMAX_ARP_RETRANSMISSIONS times before the ARP request is * aborted. */ -#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) +#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) /* ipconfigMAX_ARP_AGE defines the maximum time between an entry in the ARP * table being created or refreshed and the entry being removed because it is stale. * New ARP requests are sent for ARP cache entries that are nearing their maximum * age. ipconfigMAX_ARP_AGE is specified in tens of seconds, so a value of 150 is * equal to 1500 seconds (or 25 minutes). */ -#define ipconfigMAX_ARP_AGE 150 +#define ipconfigMAX_ARP_AGE 150 /* Implementing FreeRTOS_inet_addr() necessitates the use of string handling * routines, which are relatively large. To save code space the full @@ -210,13 +209,13 @@ * ipconfigINCLUDE_FULL_INET_ADDR is set to 1 then both FreeRTOS_inet_addr() and * FreeRTOS_indet_addr_quick() are available. If ipconfigINCLUDE_FULL_INET_ADDR is * not set to 1 then only FreeRTOS_indet_addr_quick() is available. */ -#define ipconfigINCLUDE_FULL_INET_ADDR 1 +#define ipconfigINCLUDE_FULL_INET_ADDR 1 /* ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS defines the total number of network buffer that * are available to the IP stack. The total number of network buffers is limited * to ensure the total amount of RAM that can be consumed by the IP stack is capped * to a pre-determinable value. */ -#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 +#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 /* A FreeRTOS queue is used to send events from application tasks to the IP * stack. ipconfigEVENT_QUEUE_LENGTH sets the maximum number of events that can @@ -290,7 +289,7 @@ /* The windows simulator cannot really simulate MAC interrupts, and needs to * block occasionally to allow other tasks to run. */ -#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY ( 20 / portTICK_PERIOD_MS ) +#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY pdMS_TO_TICKS( 20 ) /* Advanced only: in order to access 32-bit fields in the IP packets with * 32-bit memory instructions, all packets will be stored 32-bit-aligned, diff --git a/test/build-combination/Enable_IPv6_TCP/FreeRTOSIPConfig.h b/test/build-combination/Enable_IPv6_TCP/FreeRTOSIPConfig.h index 17e679550c..4a0c1fd554 100644 --- a/test/build-combination/Enable_IPv6_TCP/FreeRTOSIPConfig.h +++ b/test/build-combination/Enable_IPv6_TCP/FreeRTOSIPConfig.h @@ -174,8 +174,7 @@ * static IP address passed as a parameter to FreeRTOS_IPInit() if the * re-transmission time interval reaches ipconfigMAXIMUM_DISCOVER_TX_PERIOD without * a DHCP reply being received. */ -#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD \ - ( 120000U / portTICK_PERIOD_MS ) +#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD pdMS_TO_TICKS( 120000U ) /* The ARP cache is a table that maps IP addresses to MAC addresses. The IP * stack can only send a UDP message to a remove IP address if it knowns the MAC @@ -186,19 +185,19 @@ * cache then the UDP message is replaced by a ARP message that solicits the * required MAC address information. ipconfigARP_CACHE_ENTRIES defines the maximum * number of entries that can exist in the ARP table at any one time. */ -#define ipconfigARP_CACHE_ENTRIES 6 +#define ipconfigARP_CACHE_ENTRIES 6 /* ARP requests that do not result in an ARP response will be re-transmitted a * maximum of ipconfigMAX_ARP_RETRANSMISSIONS times before the ARP request is * aborted. */ -#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) +#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) /* ipconfigMAX_ARP_AGE defines the maximum time between an entry in the ARP * table being created or refreshed and the entry being removed because it is stale. * New ARP requests are sent for ARP cache entries that are nearing their maximum * age. ipconfigMAX_ARP_AGE is specified in tens of seconds, so a value of 150 is * equal to 1500 seconds (or 25 minutes). */ -#define ipconfigMAX_ARP_AGE 150 +#define ipconfigMAX_ARP_AGE 150 /* Implementing FreeRTOS_inet_addr() necessitates the use of string handling * routines, which are relatively large. To save code space the full @@ -210,13 +209,13 @@ * ipconfigINCLUDE_FULL_INET_ADDR is set to 1 then both FreeRTOS_inet_addr() and * FreeRTOS_indet_addr_quick() are available. If ipconfigINCLUDE_FULL_INET_ADDR is * not set to 1 then only FreeRTOS_indet_addr_quick() is available. */ -#define ipconfigINCLUDE_FULL_INET_ADDR 1 +#define ipconfigINCLUDE_FULL_INET_ADDR 1 /* ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS defines the total number of network buffer that * are available to the IP stack. The total number of network buffers is limited * to ensure the total amount of RAM that can be consumed by the IP stack is capped * to a pre-determinable value. */ -#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 +#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 /* A FreeRTOS queue is used to send events from application tasks to the IP * stack. ipconfigEVENT_QUEUE_LENGTH sets the maximum number of events that can @@ -290,7 +289,7 @@ /* The windows simulator cannot really simulate MAC interrupts, and needs to * block occasionally to allow other tasks to run. */ -#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY ( 20 / portTICK_PERIOD_MS ) +#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY pdMS_TO_TICKS( 20 ) /* Advanced only: in order to access 32-bit fields in the IP packets with * 32-bit memory instructions, all packets will be stored 32-bit-aligned, diff --git a/test/build-combination/Header_Self_Contain/FreeRTOSIPConfig.h b/test/build-combination/Header_Self_Contain/FreeRTOSIPConfig.h index ce7022b2ec..6285b7d929 100644 --- a/test/build-combination/Header_Self_Contain/FreeRTOSIPConfig.h +++ b/test/build-combination/Header_Self_Contain/FreeRTOSIPConfig.h @@ -142,10 +142,9 @@ * maximum allowable send block time prevents prevents a deadlock occurring when * all the network buffers are in use and the tasks that process (and subsequently * free) the network buffers are themselves blocked waiting for a network buffer. - * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in - * milliseconds can be converted to a time in ticks by dividing the time in - * milliseconds by portTICK_PERIOD_MS. */ -#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS ( 5000U / portTICK_PERIOD_MS ) + * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in + * milliseconds can be converted to a time in ticks using pdMS_TO_TICKS().*/ +#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS pdMS_TO_TICKS( 5000U ) /* If ipconfigUSE_DHCP is 1 then FreeRTOS+TCP will attempt to retrieve an IP * address, netmask, DNS server address and gateway address from a DHCP server. If @@ -170,8 +169,7 @@ * static IP address passed as a parameter to FreeRTOS_IPInit() if the * re-transmission time interval reaches ipconfigMAXIMUM_DISCOVER_TX_PERIOD without * a DHCP reply being received. */ -#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD \ - ( 120000U / portTICK_PERIOD_MS ) +#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD pdMS_TO_TICKS( 120000U ) /* The ARP cache is a table that maps IP addresses to MAC addresses. The IP * stack can only send a UDP message to a remove IP address if it knowns the MAC @@ -182,19 +180,19 @@ * cache then the UDP message is replaced by a ARP message that solicits the * required MAC address information. ipconfigARP_CACHE_ENTRIES defines the maximum * number of entries that can exist in the ARP table at any one time. */ -#define ipconfigARP_CACHE_ENTRIES 6 +#define ipconfigARP_CACHE_ENTRIES 6 /* ARP requests that do not result in an ARP response will be re-transmitted a * maximum of ipconfigMAX_ARP_RETRANSMISSIONS times before the ARP request is * aborted. */ -#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) +#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) /* ipconfigMAX_ARP_AGE defines the maximum time between an entry in the ARP * table being created or refreshed and the entry being removed because it is stale. * New ARP requests are sent for ARP cache entries that are nearing their maximum * age. ipconfigMAX_ARP_AGE is specified in tens of seconds, so a value of 150 is * equal to 1500 seconds (or 25 minutes). */ -#define ipconfigMAX_ARP_AGE 150 +#define ipconfigMAX_ARP_AGE 150 /* Implementing FreeRTOS_inet_addr() necessitates the use of string handling * routines, which are relatively large. To save code space the full @@ -206,13 +204,13 @@ * ipconfigINCLUDE_FULL_INET_ADDR is set to 1 then both FreeRTOS_inet_addr() and * FreeRTOS_indet_addr_quick() are available. If ipconfigINCLUDE_FULL_INET_ADDR is * not set to 1 then only FreeRTOS_indet_addr_quick() is available. */ -#define ipconfigINCLUDE_FULL_INET_ADDR 1 +#define ipconfigINCLUDE_FULL_INET_ADDR 1 /* ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS defines the total number of network buffer that * are available to the IP stack. The total number of network buffers is limited * to ensure the total amount of RAM that can be consumed by the IP stack is capped * to a pre-determinable value. */ -#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 +#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 /* A FreeRTOS queue is used to send events from application tasks to the IP * stack. ipconfigEVENT_QUEUE_LENGTH sets the maximum number of events that can diff --git a/test/cbmc/patches/FreeRTOSIPConfig.h b/test/cbmc/patches/FreeRTOSIPConfig.h index 55dfc29292..fe9e67b635 100644 --- a/test/cbmc/patches/FreeRTOSIPConfig.h +++ b/test/cbmc/patches/FreeRTOSIPConfig.h @@ -269,7 +269,7 @@ /* The windows simulator cannot really simulate MAC interrupts, and needs to * block occasionally to allow other tasks to run. */ -#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY ( 20 / portTICK_PERIOD_MS ) +#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY pdMS_TO_TICKS( 20 ) /* Advanced only: in order to access 32-bit fields in the IP packets with * 32-bit memory instructions, all packets will be stored 32-bit-aligned, diff --git a/test/unit-test/ConfigFiles/FreeRTOSIPConfig.h b/test/unit-test/ConfigFiles/FreeRTOSIPConfig.h index f10ea2e30a..b56dbede95 100644 --- a/test/unit-test/ConfigFiles/FreeRTOSIPConfig.h +++ b/test/unit-test/ConfigFiles/FreeRTOSIPConfig.h @@ -122,10 +122,9 @@ * maximum allowable send block time prevents prevents a deadlock occurring when * all the network buffers are in use and the tasks that process (and subsequently * free) the network buffers are themselves blocked waiting for a network buffer. - * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in - * milliseconds can be converted to a time in ticks by dividing the time in - * milliseconds by portTICK_PERIOD_MS. */ -#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS ( 5000U / portTICK_PERIOD_MS ) + * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in + * milliseconds can be converted to a time in ticks using pdMS_TO_TICKS().*/ +#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS pdMS_TO_TICKS( 5000U ) /* If ipconfigUSE_DHCP is 1 then FreeRTOS+TCP will attempt to retrieve an IP * address, netmask, DNS server address and gateway address from a DHCP server. If @@ -152,8 +151,7 @@ * static IP address passed as a parameter to FreeRTOS_IPInit() if the * re-transmission time interval reaches ipconfigMAXIMUM_DISCOVER_TX_PERIOD without * a DHCP reply being received. */ -#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD \ - ( 120000U / portTICK_PERIOD_MS ) +#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD pdMS_TO_TICKS( 120000U ) /* The ARP cache is a table that maps IP addresses to MAC addresses. The IP * stack can only send a UDP message to a remove IP address if it knowns the MAC @@ -164,19 +162,19 @@ * cache then the UDP message is replaced by a ARP message that solicits the * required MAC address information. ipconfigARP_CACHE_ENTRIES defines the maximum * number of entries that can exist in the ARP table at any one time. */ -#define ipconfigARP_CACHE_ENTRIES 6 +#define ipconfigARP_CACHE_ENTRIES 6 /* ARP requests that do not result in an ARP response will be re-transmitted a * maximum of ipconfigMAX_ARP_RETRANSMISSIONS times before the ARP request is * aborted. */ -#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) +#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) /* ipconfigMAX_ARP_AGE defines the maximum time between an entry in the ARP * table being created or refreshed and the entry being removed because it is stale. * New ARP requests are sent for ARP cache entries that are nearing their maximum * age. ipconfigMAX_ARP_AGE is specified in tens of seconds, so a value of 150 is * equal to 1500 seconds (or 25 minutes). */ -#define ipconfigMAX_ARP_AGE 150 +#define ipconfigMAX_ARP_AGE 150 /* Implementing FreeRTOS_inet_addr() necessitates the use of string handling * routines, which are relatively large. To save code space the full @@ -188,13 +186,13 @@ * ipconfigINCLUDE_FULL_INET_ADDR is set to 1 then both FreeRTOS_inet_addr() and * FreeRTOS_indet_addr_quick() are available. If ipconfigINCLUDE_FULL_INET_ADDR is * not set to 1 then only FreeRTOS_indet_addr_quick() is available. */ -#define ipconfigINCLUDE_FULL_INET_ADDR 1 +#define ipconfigINCLUDE_FULL_INET_ADDR 1 /* ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS defines the total number of network buffer that * are available to the IP stack. The total number of network buffers is limited * to ensure the total amount of RAM that can be consumed by the IP stack is capped * to a pre-determinable value. */ -#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 +#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 /* A FreeRTOS queue is used to send events from application tasks to the IP * stack. ipconfigEVENT_QUEUE_LENGTH sets the maximum number of events that can @@ -268,7 +266,7 @@ /* The windows simulator cannot really simulate MAC interrupts, and needs to * block occasionally to allow other tasks to run. */ -#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY ( 20 / portTICK_PERIOD_MS ) +#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY pdMS_TO_TICKS( 20 ) /* Advanced only: in order to access 32-bit fields in the IP packets with * 32-bit memory instructions, all packets will be stored 32-bit-aligned, diff --git a/test/unit-test/FreeRTOS_ARP_DataLenLessThanMinPacket/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_ARP_DataLenLessThanMinPacket/FreeRTOSIPConfig.h index 8c2a65c70d..94aa59bac1 100644 --- a/test/unit-test/FreeRTOS_ARP_DataLenLessThanMinPacket/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_ARP_DataLenLessThanMinPacket/FreeRTOSIPConfig.h @@ -262,7 +262,7 @@ /* The windows simulator cannot really simulate MAC interrupts, and needs to * block occasionally to allow other tasks to run. */ -#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY ( 20 / portTICK_PERIOD_MS ) +#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY pdMS_TO_TICKS( 20 ) /* Advanced only: in order to access 32-bit fields in the IP packets with * 32-bit memory instructions, all packets will be stored 32-bit-aligned, diff --git a/test/unit-test/FreeRTOS_DHCPv6/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_DHCPv6/FreeRTOSIPConfig.h index 8dcb9d8659..1415fe2f6e 100644 --- a/test/unit-test/FreeRTOS_DHCPv6/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_DHCPv6/FreeRTOSIPConfig.h @@ -120,10 +120,9 @@ * maximum allowable send block time prevents prevents a deadlock occurring when * all the network buffers are in use and the tasks that process (and subsequently * free) the network buffers are themselves blocked waiting for a network buffer. - * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in - * milliseconds can be converted to a time in ticks by dividing the time in - * milliseconds by portTICK_PERIOD_MS. */ -#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS ( 5000U / portTICK_PERIOD_MS ) + * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in + * milliseconds can be converted to a time in ticks using pdMS_TO_TICKS().*/ +#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS pdMS_TO_TICKS( 5000U ) /* If ipconfigUSE_DHCP is 1 then FreeRTOS+TCP will attempt to retrieve an IP * address, netmask, DNS server address and gateway address from a DHCP server. If @@ -150,7 +149,7 @@ * static IP address passed as a parameter to FreeRTOS_IPInit() if the * re-transmission time interval reaches ipconfigMAXIMUM_DISCOVER_TX_PERIOD without * a DHCP reply being received. */ -#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD ( 30000U / portTICK_PERIOD_MS ) +#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD pdMS_TO_TICKS( 30000U ) /* The ARP cache is a table that maps IP addresses to MAC addresses. The IP * stack can only send a UDP message to a remove IP address if it knowns the MAC diff --git a/test/unit-test/FreeRTOS_DNS/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_DNS/FreeRTOSIPConfig.h index 52819c5ae8..a438dea52a 100644 --- a/test/unit-test/FreeRTOS_DNS/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_DNS/FreeRTOSIPConfig.h @@ -151,7 +151,7 @@ * static IP address passed as a parameter to FreeRTOS_IPInit() if the * re-transmission time interval reaches ipconfigMAXIMUM_DISCOVER_TX_PERIOD without * a DHCP reply being received. */ -#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD ( 30000U / portTICK_PERIOD_MS ) +#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD pdMS_TO_TICKS( 30000U ) /* The ARP cache is a table that maps IP addresses to MAC addresses. The IP * stack can only send a UDP message to a remove IP address if it knowns the MAC diff --git a/test/unit-test/FreeRTOS_DNS_Parser/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_DNS_Parser/FreeRTOSIPConfig.h index 5b740c2828..95039adcee 100644 --- a/test/unit-test/FreeRTOS_DNS_Parser/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_DNS_Parser/FreeRTOSIPConfig.h @@ -120,10 +120,9 @@ * maximum allowable send block time prevents prevents a deadlock occurring when * all the network buffers are in use and the tasks that process (and subsequently * free) the network buffers are themselves blocked waiting for a network buffer. - * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in - * milliseconds can be converted to a time in ticks by dividing the time in - * milliseconds by portTICK_PERIOD_MS. */ -#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS ( 5000U / portTICK_PERIOD_MS ) + * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in + * milliseconds can be converted to a time in ticks using pdMS_TO_TICKS().*/ +#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS pdMS_TO_TICKS( 5000U ) /* If ipconfigUSE_DHCP is 1 then FreeRTOS+TCP will attempt to retrieve an IP * address, netmask, DNS server address and gateway address from a DHCP server. If @@ -266,7 +265,7 @@ /* The windows simulator cannot really simulate MAC interrupts, and needs to * block occasionally to allow other tasks to run. */ -#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY ( 20 / portTICK_PERIOD_MS ) +#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY pdMS_TO_TICKS( 20 ) /* Advanced only: in order to access 32-bit fields in the IP packets with * 32-bit memory instructions, all packets will be stored 32-bit-aligned, diff --git a/test/unit-test/FreeRTOS_IP_DiffConfig/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_IP_DiffConfig/FreeRTOSIPConfig.h index f9da2bf5a7..3c3961aab6 100644 --- a/test/unit-test/FreeRTOS_IP_DiffConfig/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_IP_DiffConfig/FreeRTOSIPConfig.h @@ -149,8 +149,7 @@ * static IP address passed as a parameter to FreeRTOS_IPInit() if the * re-transmission time interval reaches ipconfigMAXIMUM_DISCOVER_TX_PERIOD without * a DHCP reply being received. */ -#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD \ - ( 120000U / portTICK_PERIOD_MS ) +#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD pdMS_TO_TICKS( 120000U ) /* The ARP cache is a table that maps IP addresses to MAC addresses. The IP * stack can only send a UDP message to a remove IP address if it knowns the MAC @@ -161,19 +160,19 @@ * cache then the UDP message is replaced by a ARP message that solicits the * required MAC address information. ipconfigARP_CACHE_ENTRIES defines the maximum * number of entries that can exist in the ARP table at any one time. */ -#define ipconfigARP_CACHE_ENTRIES 6 +#define ipconfigARP_CACHE_ENTRIES 6 /* ARP requests that do not result in an ARP response will be re-transmitted a * maximum of ipconfigMAX_ARP_RETRANSMISSIONS times before the ARP request is * aborted. */ -#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) +#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) /* ipconfigMAX_ARP_AGE defines the maximum time between an entry in the ARP * table being created or refreshed and the entry being removed because it is stale. * New ARP requests are sent for ARP cache entries that are nearing their maximum * age. ipconfigMAX_ARP_AGE is specified in tens of seconds, so a value of 150 is * equal to 1500 seconds (or 25 minutes). */ -#define ipconfigMAX_ARP_AGE 150 +#define ipconfigMAX_ARP_AGE 150 /* Implementing FreeRTOS_inet_addr() necessitates the use of string handling * routines, which are relatively large. To save code space the full @@ -185,13 +184,13 @@ * ipconfigINCLUDE_FULL_INET_ADDR is set to 1 then both FreeRTOS_inet_addr() and * FreeRTOS_indet_addr_quick() are available. If ipconfigINCLUDE_FULL_INET_ADDR is * not set to 1 then only FreeRTOS_indet_addr_quick() is available. */ -#define ipconfigINCLUDE_FULL_INET_ADDR 1 +#define ipconfigINCLUDE_FULL_INET_ADDR 1 /* ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS defines the total number of network buffer that * are available to the IP stack. The total number of network buffers is limited * to ensure the total amount of RAM that can be consumed by the IP stack is capped * to a pre-determinable value. */ -#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 +#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 /* A FreeRTOS queue is used to send events from application tasks to the IP * stack. ipconfigEVENT_QUEUE_LENGTH sets the maximum number of events that can @@ -265,7 +264,7 @@ /* The windows simulator cannot really simulate MAC interrupts, and needs to * block occasionally to allow other tasks to run. */ -#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY ( 20 / portTICK_PERIOD_MS ) +#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY pdMS_TO_TICKS( 20 ) /* Advanced only: in order to access 32-bit fields in the IP packets with * 32-bit memory instructions, all packets will be stored 32-bit-aligned, diff --git a/test/unit-test/FreeRTOS_IP_DiffConfig1/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_IP_DiffConfig1/FreeRTOSIPConfig.h index 4aa2dee504..19d6542acf 100644 --- a/test/unit-test/FreeRTOS_IP_DiffConfig1/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_IP_DiffConfig1/FreeRTOSIPConfig.h @@ -119,10 +119,9 @@ * maximum allowable send block time prevents prevents a deadlock occurring when * all the network buffers are in use and the tasks that process (and subsequently * free) the network buffers are themselves blocked waiting for a network buffer. - * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in - * milliseconds can be converted to a time in ticks by dividing the time in - * milliseconds by portTICK_PERIOD_MS. */ -#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS ( 5000U / portTICK_PERIOD_MS ) + * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in + * milliseconds can be converted to a time in ticks using pdMS_TO_TICKS().*/ +#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS pdMS_TO_TICKS( 5000U ) /* If ipconfigUSE_DHCP is 1 then FreeRTOS+TCP will attempt to retrieve an IP * address, netmask, DNS server address and gateway address from a DHCP server. If @@ -265,7 +264,7 @@ /* The windows simulator cannot really simulate MAC interrupts, and needs to * block occasionally to allow other tasks to run. */ -#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY ( 20 / portTICK_PERIOD_MS ) +#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY pdMS_TO_TICKS( 20 ) /* Advanced only: in order to access 32-bit fields in the IP packets with * 32-bit memory instructions, all packets will be stored 32-bit-aligned, diff --git a/test/unit-test/FreeRTOS_IP_DiffConfig2/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_IP_DiffConfig2/FreeRTOSIPConfig.h index 45964ca96a..d2068ffc17 100644 --- a/test/unit-test/FreeRTOS_IP_DiffConfig2/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_IP_DiffConfig2/FreeRTOSIPConfig.h @@ -119,10 +119,9 @@ * maximum allowable send block time prevents prevents a deadlock occurring when * all the network buffers are in use and the tasks that process (and subsequently * free) the network buffers are themselves blocked waiting for a network buffer. - * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in - * milliseconds can be converted to a time in ticks by dividing the time in - * milliseconds by portTICK_PERIOD_MS. */ -#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS ( 5000U / portTICK_PERIOD_MS ) + * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in + * milliseconds can be converted to a time in ticks using pdMS_TO_TICKS().*/ +#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS pdMS_TO_TICKS( 5000U ) /* If ipconfigUSE_DHCP is 1 then FreeRTOS+TCP will attempt to retrieve an IP * address, netmask, DNS server address and gateway address from a DHCP server. If @@ -149,8 +148,7 @@ * static IP address passed as a parameter to FreeRTOS_IPInit() if the * re-transmission time interval reaches ipconfigMAXIMUM_DISCOVER_TX_PERIOD without * a DHCP reply being received. */ -#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD \ - ( 120000U / portTICK_PERIOD_MS ) +#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD pdMS_TO_TICKS( 120000U ) /* The ARP cache is a table that maps IP addresses to MAC addresses. The IP * stack can only send a UDP message to a remove IP address if it knowns the MAC @@ -161,19 +159,19 @@ * cache then the UDP message is replaced by a ARP message that solicits the * required MAC address information. ipconfigARP_CACHE_ENTRIES defines the maximum * number of entries that can exist in the ARP table at any one time. */ -#define ipconfigARP_CACHE_ENTRIES 6 +#define ipconfigARP_CACHE_ENTRIES 6 /* ARP requests that do not result in an ARP response will be re-transmitted a * maximum of ipconfigMAX_ARP_RETRANSMISSIONS times before the ARP request is * aborted. */ -#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) +#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) /* ipconfigMAX_ARP_AGE defines the maximum time between an entry in the ARP * table being created or refreshed and the entry being removed because it is stale. * New ARP requests are sent for ARP cache entries that are nearing their maximum * age. ipconfigMAX_ARP_AGE is specified in tens of seconds, so a value of 150 is * equal to 1500 seconds (or 25 minutes). */ -#define ipconfigMAX_ARP_AGE 150 +#define ipconfigMAX_ARP_AGE 150 /* Implementing FreeRTOS_inet_addr() necessitates the use of string handling * routines, which are relatively large. To save code space the full @@ -185,13 +183,13 @@ * ipconfigINCLUDE_FULL_INET_ADDR is set to 1 then both FreeRTOS_inet_addr() and * FreeRTOS_indet_addr_quick() are available. If ipconfigINCLUDE_FULL_INET_ADDR is * not set to 1 then only FreeRTOS_indet_addr_quick() is available. */ -#define ipconfigINCLUDE_FULL_INET_ADDR 1 +#define ipconfigINCLUDE_FULL_INET_ADDR 1 /* ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS defines the total number of network buffer that * are available to the IP stack. The total number of network buffers is limited * to ensure the total amount of RAM that can be consumed by the IP stack is capped * to a pre-determinable value. */ -#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 +#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 /* A FreeRTOS queue is used to send events from application tasks to the IP * stack. ipconfigEVENT_QUEUE_LENGTH sets the maximum number of events that can diff --git a/test/unit-test/FreeRTOS_IP_DiffConfig3/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_IP_DiffConfig3/FreeRTOSIPConfig.h index 9454ff172a..09d91101c7 100644 --- a/test/unit-test/FreeRTOS_IP_DiffConfig3/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_IP_DiffConfig3/FreeRTOSIPConfig.h @@ -121,10 +121,9 @@ * maximum allowable send block time prevents prevents a deadlock occurring when * all the network buffers are in use and the tasks that process (and subsequently * free) the network buffers are themselves blocked waiting for a network buffer. - * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in - * milliseconds can be converted to a time in ticks by dividing the time in - * milliseconds by portTICK_PERIOD_MS. */ -#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS ( 5000U / portTICK_PERIOD_MS ) + * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in + * milliseconds can be converted to a time in ticks using pdMS_TO_TICKS().*/ +#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS pdMS_TO_TICKS( 5000U ) /* If ipconfigUSE_DHCP is 1 then FreeRTOS+TCP will attempt to retrieve an IP * address, netmask, DNS server address and gateway address from a DHCP server. If @@ -276,7 +275,7 @@ /* The windows simulator cannot really simulate MAC interrupts, and needs to * block occasionally to allow other tasks to run. */ -#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY ( 20 / portTICK_PERIOD_MS ) +#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY pdMS_TO_TICKS( 20 ) /* Advanced only: in order to access 32-bit fields in the IP packets with * 32-bit memory instructions, all packets will be stored 32-bit-aligned, diff --git a/test/unit-test/FreeRTOS_IP_Utils/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_IP_Utils/FreeRTOSIPConfig.h index 3662a23487..3059dbb9fa 100644 --- a/test/unit-test/FreeRTOS_IP_Utils/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_IP_Utils/FreeRTOSIPConfig.h @@ -152,8 +152,7 @@ * static IP address passed as a parameter to FreeRTOS_IPInit() if the * re-transmission time interval reaches ipconfigMAXIMUM_DISCOVER_TX_PERIOD without * a DHCP reply being received. */ -#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD \ - ( 120000U / portTICK_PERIOD_MS ) +#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD pdMS_TO_TICKS( 120000U ) /* The ARP cache is a table that maps IP addresses to MAC addresses. The IP * stack can only send a UDP message to a remove IP address if it knowns the MAC @@ -164,19 +163,19 @@ * cache then the UDP message is replaced by a ARP message that solicits the * required MAC address information. ipconfigARP_CACHE_ENTRIES defines the maximum * number of entries that can exist in the ARP table at any one time. */ -#define ipconfigARP_CACHE_ENTRIES 6 +#define ipconfigARP_CACHE_ENTRIES 6 /* ARP requests that do not result in an ARP response will be re-transmitted a * maximum of ipconfigMAX_ARP_RETRANSMISSIONS times before the ARP request is * aborted. */ -#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) +#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) /* ipconfigMAX_ARP_AGE defines the maximum time between an entry in the ARP * table being created or refreshed and the entry being removed because it is stale. * New ARP requests are sent for ARP cache entries that are nearing their maximum * age. ipconfigMAX_ARP_AGE is specified in tens of seconds, so a value of 150 is * equal to 1500 seconds (or 25 minutes). */ -#define ipconfigMAX_ARP_AGE 150 +#define ipconfigMAX_ARP_AGE 150 /* Implementing FreeRTOS_inet_addr() necessitates the use of string handling * routines, which are relatively large. To save code space the full @@ -188,13 +187,13 @@ * ipconfigINCLUDE_FULL_INET_ADDR is set to 1 then both FreeRTOS_inet_addr() and * FreeRTOS_indet_addr_quick() are available. If ipconfigINCLUDE_FULL_INET_ADDR is * not set to 1 then only FreeRTOS_indet_addr_quick() is available. */ -#define ipconfigINCLUDE_FULL_INET_ADDR 1 +#define ipconfigINCLUDE_FULL_INET_ADDR 1 /* ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS defines the total number of network buffer that * are available to the IP stack. The total number of network buffers is limited * to ensure the total amount of RAM that can be consumed by the IP stack is capped * to a pre-determinable value. */ -#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 +#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 /* A FreeRTOS queue is used to send events from application tasks to the IP * stack. ipconfigEVENT_QUEUE_LENGTH sets the maximum number of events that can @@ -268,7 +267,7 @@ /* The windows simulator cannot really simulate MAC interrupts, and needs to * block occasionally to allow other tasks to run. */ -#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY ( 20 / portTICK_PERIOD_MS ) +#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY pdMS_TO_TICKS( 20 ) /* Advanced only: in order to access 32-bit fields in the IP packets with * 32-bit memory instructions, all packets will be stored 32-bit-aligned, diff --git a/test/unit-test/FreeRTOS_IPv4_DiffConfig/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_IPv4_DiffConfig/FreeRTOSIPConfig.h index 6eb551d56d..fcef08e6a0 100644 --- a/test/unit-test/FreeRTOS_IPv4_DiffConfig/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_IPv4_DiffConfig/FreeRTOSIPConfig.h @@ -119,10 +119,9 @@ * maximum allowable send block time prevents prevents a deadlock occurring when * all the network buffers are in use and the tasks that process (and subsequently * free) the network buffers are themselves blocked waiting for a network buffer. - * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in - * milliseconds can be converted to a time in ticks by dividing the time in - * milliseconds by portTICK_PERIOD_MS. */ -#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS ( 5000U / portTICK_PERIOD_MS ) + * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in + * milliseconds can be converted to a time in ticks using pdMS_TO_TICKS().*/ +#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS pdMS_TO_TICKS( 5000U ) /* If ipconfigUSE_DHCP is 1 then FreeRTOS+TCP will attempt to retrieve an IP * address, netmask, DNS server address and gateway address from a DHCP server. If @@ -149,8 +148,7 @@ * static IP address passed as a parameter to FreeRTOS_IPInit() if the * re-transmission time interval reaches ipconfigMAXIMUM_DISCOVER_TX_PERIOD without * a DHCP reply being received. */ -#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD \ - ( 120000U / portTICK_PERIOD_MS ) +#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD pdMS_TO_TICKS( 120000U ) /* The ARP cache is a table that maps IP addresses to MAC addresses. The IP * stack can only send a UDP message to a remove IP address if it knowns the MAC @@ -161,19 +159,19 @@ * cache then the UDP message is replaced by a ARP message that solicits the * required MAC address information. ipconfigARP_CACHE_ENTRIES defines the maximum * number of entries that can exist in the ARP table at any one time. */ -#define ipconfigARP_CACHE_ENTRIES 6 +#define ipconfigARP_CACHE_ENTRIES 6 /* ARP requests that do not result in an ARP response will be re-transmitted a * maximum of ipconfigMAX_ARP_RETRANSMISSIONS times before the ARP request is * aborted. */ -#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) +#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) /* ipconfigMAX_ARP_AGE defines the maximum time between an entry in the ARP * table being created or refreshed and the entry being removed because it is stale. * New ARP requests are sent for ARP cache entries that are nearing their maximum * age. ipconfigMAX_ARP_AGE is specified in tens of seconds, so a value of 150 is * equal to 1500 seconds (or 25 minutes). */ -#define ipconfigMAX_ARP_AGE 150 +#define ipconfigMAX_ARP_AGE 150 /* Implementing FreeRTOS_inet_addr() necessitates the use of string handling * routines, which are relatively large. To save code space the full @@ -185,13 +183,13 @@ * ipconfigINCLUDE_FULL_INET_ADDR is set to 1 then both FreeRTOS_inet_addr() and * FreeRTOS_indet_addr_quick() are available. If ipconfigINCLUDE_FULL_INET_ADDR is * not set to 1 then only FreeRTOS_indet_addr_quick() is available. */ -#define ipconfigINCLUDE_FULL_INET_ADDR 1 +#define ipconfigINCLUDE_FULL_INET_ADDR 1 /* ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS defines the total number of network buffer that * are available to the IP stack. The total number of network buffers is limited * to ensure the total amount of RAM that can be consumed by the IP stack is capped * to a pre-determinable value. */ -#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 +#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 /* A FreeRTOS queue is used to send events from application tasks to the IP * stack. ipconfigEVENT_QUEUE_LENGTH sets the maximum number of events that can @@ -265,7 +263,7 @@ /* The windows simulator cannot really simulate MAC interrupts, and needs to * block occasionally to allow other tasks to run. */ -#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY ( 20 / portTICK_PERIOD_MS ) +#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY pdMS_TO_TICKS( 20 ) /* Advanced only: in order to access 32-bit fields in the IP packets with * 32-bit memory instructions, all packets will be stored 32-bit-aligned, diff --git a/test/unit-test/FreeRTOS_IPv4_DiffConfig1/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_IPv4_DiffConfig1/FreeRTOSIPConfig.h index 2ad3ba3c2e..06083b4647 100644 --- a/test/unit-test/FreeRTOS_IPv4_DiffConfig1/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_IPv4_DiffConfig1/FreeRTOSIPConfig.h @@ -274,7 +274,7 @@ /* The windows simulator cannot really simulate MAC interrupts, and needs to * block occasionally to allow other tasks to run. */ -#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY ( 20 / portTICK_PERIOD_MS ) +#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY pdMS_TO_TICKS( 20 ) /* Advanced only: in order to access 32-bit fields in the IP packets with * 32-bit memory instructions, all packets will be stored 32-bit-aligned, diff --git a/test/unit-test/FreeRTOS_IPv6/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_IPv6/FreeRTOSIPConfig.h index 6b4f63f1fc..5775b8ed9f 100644 --- a/test/unit-test/FreeRTOS_IPv6/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_IPv6/FreeRTOSIPConfig.h @@ -119,10 +119,9 @@ * maximum allowable send block time prevents prevents a deadlock occurring when * all the network buffers are in use and the tasks that process (and subsequently * free) the network buffers are themselves blocked waiting for a network buffer. - * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in - * milliseconds can be converted to a time in ticks by dividing the time in - * milliseconds by portTICK_PERIOD_MS. */ -#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS ( 5000U / portTICK_PERIOD_MS ) + * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in + * milliseconds can be converted to a time in ticks using pdMS_TO_TICKS().*/ +#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS pdMS_TO_TICKS( 5000U ) /* If ipconfigUSE_DHCP is 1 then FreeRTOS+TCP will attempt to retrieve an IP * address, netmask, DNS server address and gateway address from a DHCP server. If diff --git a/test/unit-test/FreeRTOS_IPv6_ConfigDriverCheckChecksum/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_IPv6_ConfigDriverCheckChecksum/FreeRTOSIPConfig.h index 61009fb7e0..b0fcd3f01c 100644 --- a/test/unit-test/FreeRTOS_IPv6_ConfigDriverCheckChecksum/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_IPv6_ConfigDriverCheckChecksum/FreeRTOSIPConfig.h @@ -149,8 +149,7 @@ * static IP address passed as a parameter to FreeRTOS_IPInit() if the * re-transmission time interval reaches ipconfigMAXIMUM_DISCOVER_TX_PERIOD without * a DHCP reply being received. */ -#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD \ - ( 120000U / portTICK_PERIOD_MS ) +#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD pdMS_TO_TICKS( 120000U ) /* The ARP cache is a table that maps IP addresses to MAC addresses. The IP * stack can only send a UDP message to a remove IP address if it knowns the MAC @@ -161,19 +160,19 @@ * cache then the UDP message is replaced by a ARP message that solicits the * required MAC address information. ipconfigARP_CACHE_ENTRIES defines the maximum * number of entries that can exist in the ARP table at any one time. */ -#define ipconfigARP_CACHE_ENTRIES 6 +#define ipconfigARP_CACHE_ENTRIES 6 /* ARP requests that do not result in an ARP response will be re-transmitted a * maximum of ipconfigMAX_ARP_RETRANSMISSIONS times before the ARP request is * aborted. */ -#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) +#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) /* ipconfigMAX_ARP_AGE defines the maximum time between an entry in the ARP * table being created or refreshed and the entry being removed because it is stale. * New ARP requests are sent for ARP cache entries that are nearing their maximum * age. ipconfigMAX_ARP_AGE is specified in tens of seconds, so a value of 150 is * equal to 1500 seconds (or 25 minutes). */ -#define ipconfigMAX_ARP_AGE 150 +#define ipconfigMAX_ARP_AGE 150 /* Implementing FreeRTOS_inet_addr() necessitates the use of string handling * routines, which are relatively large. To save code space the full @@ -185,13 +184,13 @@ * ipconfigINCLUDE_FULL_INET_ADDR is set to 1 then both FreeRTOS_inet_addr() and * FreeRTOS_indet_addr_quick() are available. If ipconfigINCLUDE_FULL_INET_ADDR is * not set to 1 then only FreeRTOS_indet_addr_quick() is available. */ -#define ipconfigINCLUDE_FULL_INET_ADDR 1 +#define ipconfigINCLUDE_FULL_INET_ADDR 1 /* ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS defines the total number of network buffer that * are available to the IP stack. The total number of network buffers is limited * to ensure the total amount of RAM that can be consumed by the IP stack is capped * to a pre-determinable value. */ -#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 +#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 /* A FreeRTOS queue is used to send events from application tasks to the IP * stack. ipconfigEVENT_QUEUE_LENGTH sets the maximum number of events that can @@ -265,7 +264,7 @@ /* The windows simulator cannot really simulate MAC interrupts, and needs to * block occasionally to allow other tasks to run. */ -#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY ( 20 / portTICK_PERIOD_MS ) +#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY pdMS_TO_TICKS( 20 ) /* Advanced only: in order to access 32-bit fields in the IP packets with * 32-bit memory instructions, all packets will be stored 32-bit-aligned, diff --git a/test/unit-test/FreeRTOS_IPv6_Utils/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_IPv6_Utils/FreeRTOSIPConfig.h index dbd9c417f8..49ee70d7f7 100644 --- a/test/unit-test/FreeRTOS_IPv6_Utils/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_IPv6_Utils/FreeRTOSIPConfig.h @@ -118,10 +118,9 @@ * maximum allowable send block time prevents prevents a deadlock occurring when * all the network buffers are in use and the tasks that process (and subsequently * free) the network buffers are themselves blocked waiting for a network buffer. - * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in - * milliseconds can be converted to a time in ticks by dividing the time in - * milliseconds by portTICK_PERIOD_MS. */ -#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS ( 5000U / portTICK_PERIOD_MS ) + * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in + * milliseconds can be converted to a time in ticks using pdMS_TO_TICKS().*/ +#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS pdMS_TO_TICKS( 5000U ) /* If ipconfigUSE_DHCP is 1 then FreeRTOS+TCP will attempt to retrieve an IP * address, netmask, DNS server address and gateway address from a DHCP server. If diff --git a/test/unit-test/FreeRTOS_Routing/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_Routing/FreeRTOSIPConfig.h index 594af2296a..03f4a5d1e8 100644 --- a/test/unit-test/FreeRTOS_Routing/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_Routing/FreeRTOSIPConfig.h @@ -122,10 +122,9 @@ * maximum allowable send block time prevents prevents a deadlock occurring when * all the network buffers are in use and the tasks that process (and subsequently * free) the network buffers are themselves blocked waiting for a network buffer. - * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in - * milliseconds can be converted to a time in ticks by dividing the time in - * milliseconds by portTICK_PERIOD_MS. */ -#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS ( 5000U / portTICK_PERIOD_MS ) + * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in + * milliseconds can be converted to a time in ticks using pdMS_TO_TICKS().*/ +#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS pdMS_TO_TICKS( 5000U ) /* If ipconfigUSE_DHCP is 1 then FreeRTOS+TCP will attempt to retrieve an IP * address, netmask, DNS server address and gateway address from a DHCP server. If @@ -152,8 +151,7 @@ * static IP address passed as a parameter to FreeRTOS_IPInit() if the * re-transmission time interval reaches ipconfigMAXIMUM_DISCOVER_TX_PERIOD without * a DHCP reply being received. */ -#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD \ - ( 120000U / portTICK_PERIOD_MS ) +#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD pdMS_TO_TICKS( 120000U ) /* The ARP cache is a table that maps IP addresses to MAC addresses. The IP * stack can only send a UDP message to a remove IP address if it knowns the MAC @@ -164,19 +162,19 @@ * cache then the UDP message is replaced by a ARP message that solicits the * required MAC address information. ipconfigARP_CACHE_ENTRIES defines the maximum * number of entries that can exist in the ARP table at any one time. */ -#define ipconfigARP_CACHE_ENTRIES 6 +#define ipconfigARP_CACHE_ENTRIES 6 /* ARP requests that do not result in an ARP response will be re-transmitted a * maximum of ipconfigMAX_ARP_RETRANSMISSIONS times before the ARP request is * aborted. */ -#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) +#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) /* ipconfigMAX_ARP_AGE defines the maximum time between an entry in the ARP * table being created or refreshed and the entry being removed because it is stale. * New ARP requests are sent for ARP cache entries that are nearing their maximum * age. ipconfigMAX_ARP_AGE is specified in tens of seconds, so a value of 150 is * equal to 1500 seconds (or 25 minutes). */ -#define ipconfigMAX_ARP_AGE 150 +#define ipconfigMAX_ARP_AGE 150 /* Implementing FreeRTOS_inet_addr() necessitates the use of string handling * routines, which are relatively large. To save code space the full @@ -188,13 +186,13 @@ * ipconfigINCLUDE_FULL_INET_ADDR is set to 1 then both FreeRTOS_inet_addr() and * FreeRTOS_indet_addr_quick() are available. If ipconfigINCLUDE_FULL_INET_ADDR is * not set to 1 then only FreeRTOS_indet_addr_quick() is available. */ -#define ipconfigINCLUDE_FULL_INET_ADDR 1 +#define ipconfigINCLUDE_FULL_INET_ADDR 1 /* ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS defines the total number of network buffer that * are available to the IP stack. The total number of network buffers is limited * to ensure the total amount of RAM that can be consumed by the IP stack is capped * to a pre-determinable value. */ -#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 +#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 /* A FreeRTOS queue is used to send events from application tasks to the IP * stack. ipconfigEVENT_QUEUE_LENGTH sets the maximum number of events that can @@ -268,7 +266,7 @@ /* The windows simulator cannot really simulate MAC interrupts, and needs to * block occasionally to allow other tasks to run. */ -#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY ( 20 / portTICK_PERIOD_MS ) +#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY pdMS_TO_TICKS( 20 ) /* Advanced only: in order to access 32-bit fields in the IP packets with * 32-bit memory instructions, all packets will be stored 32-bit-aligned, diff --git a/test/unit-test/FreeRTOS_Routing_ConfigV4Only/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_Routing_ConfigV4Only/FreeRTOSIPConfig.h index ddc95ecdb2..7e8185a70e 100644 --- a/test/unit-test/FreeRTOS_Routing_ConfigV4Only/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_Routing_ConfigV4Only/FreeRTOSIPConfig.h @@ -128,10 +128,9 @@ * maximum allowable send block time prevents prevents a deadlock occurring when * all the network buffers are in use and the tasks that process (and subsequently * free) the network buffers are themselves blocked waiting for a network buffer. - * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in - * milliseconds can be converted to a time in ticks by dividing the time in - * milliseconds by portTICK_PERIOD_MS. */ -#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS ( 5000U / portTICK_PERIOD_MS ) + * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in + * milliseconds can be converted to a time in ticks using pdMS_TO_TICKS().*/ +#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS pdMS_TO_TICKS( 5000U ) /* If ipconfigUSE_DHCP is 1 then FreeRTOS+TCP will attempt to retrieve an IP * address, netmask, DNS server address and gateway address from a DHCP server. If @@ -274,7 +273,7 @@ /* The windows simulator cannot really simulate MAC interrupts, and needs to * block occasionally to allow other tasks to run. */ -#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY ( 20 / portTICK_PERIOD_MS ) +#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY pdMS_TO_TICKS( 20 ) /* Advanced only: in order to access 32-bit fields in the IP packets with * 32-bit memory instructions, all packets will be stored 32-bit-aligned, diff --git a/test/unit-test/FreeRTOS_Sockets_DiffConfig/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_Sockets_DiffConfig/FreeRTOSIPConfig.h index 1d50c302eb..a6cc6e451d 100644 --- a/test/unit-test/FreeRTOS_Sockets_DiffConfig/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_Sockets_DiffConfig/FreeRTOSIPConfig.h @@ -116,10 +116,9 @@ * maximum allowable send block time prevents prevents a deadlock occurring when * all the network buffers are in use and the tasks that process (and subsequently * free) the network buffers are themselves blocked waiting for a network buffer. - * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in - * milliseconds can be converted to a time in ticks by dividing the time in - * milliseconds by portTICK_PERIOD_MS. */ -#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS ( 5000U / portTICK_PERIOD_MS ) + * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in + * milliseconds can be converted to a time in ticks using pdMS_TO_TICKS().*/ +#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS pdMS_TO_TICKS( 5000U ) /* If ipconfigUSE_DHCP is 1 then FreeRTOS+TCP will attempt to retrieve an IP * address, netmask, DNS server address and gateway address from a DHCP server. If @@ -146,8 +145,7 @@ * static IP address passed as a parameter to FreeRTOS_IPInit() if the * re-transmission time interval reaches ipconfigMAXIMUM_DISCOVER_TX_PERIOD without * a DHCP reply being received. */ -#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD \ - ( 120000U / portTICK_PERIOD_MS ) +#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD pdMS_TO_TICKS( 120000U ) /* The ARP cache is a table that maps IP addresses to MAC addresses. The IP * stack can only send a UDP message to a remove IP address if it knowns the MAC @@ -158,19 +156,19 @@ * cache then the UDP message is replaced by a ARP message that solicits the * required MAC address information. ipconfigARP_CACHE_ENTRIES defines the maximum * number of entries that can exist in the ARP table at any one time. */ -#define ipconfigARP_CACHE_ENTRIES 6 +#define ipconfigARP_CACHE_ENTRIES 6 /* ARP requests that do not result in an ARP response will be re-transmitted a * maximum of ipconfigMAX_ARP_RETRANSMISSIONS times before the ARP request is * aborted. */ -#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) +#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) /* ipconfigMAX_ARP_AGE defines the maximum time between an entry in the ARP * table being created or refreshed and the entry being removed because it is stale. * New ARP requests are sent for ARP cache entries that are nearing their maximum * age. ipconfigMAX_ARP_AGE is specified in tens of seconds, so a value of 150 is * equal to 1500 seconds (or 25 minutes). */ -#define ipconfigMAX_ARP_AGE 150 +#define ipconfigMAX_ARP_AGE 150 /* Implementing FreeRTOS_inet_addr() necessitates the use of string handling * routines, which are relatively large. To save code space the full @@ -182,13 +180,13 @@ * ipconfigINCLUDE_FULL_INET_ADDR is set to 1 then both FreeRTOS_inet_addr() and * FreeRTOS_indet_addr_quick() are available. If ipconfigINCLUDE_FULL_INET_ADDR is * not set to 1 then only FreeRTOS_indet_addr_quick() is available. */ -#define ipconfigINCLUDE_FULL_INET_ADDR 1 +#define ipconfigINCLUDE_FULL_INET_ADDR 1 /* ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS defines the total number of network buffer that * are available to the IP stack. The total number of network buffers is limited * to ensure the total amount of RAM that can be consumed by the IP stack is capped * to a pre-determinable value. */ -#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 +#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 /* A FreeRTOS queue is used to send events from application tasks to the IP * stack. ipconfigEVENT_QUEUE_LENGTH sets the maximum number of events that can diff --git a/test/unit-test/FreeRTOS_Sockets_DiffConfig1/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_Sockets_DiffConfig1/FreeRTOSIPConfig.h index da390dc439..a010ec7fbc 100644 --- a/test/unit-test/FreeRTOS_Sockets_DiffConfig1/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_Sockets_DiffConfig1/FreeRTOSIPConfig.h @@ -148,8 +148,7 @@ * static IP address passed as a parameter to FreeRTOS_IPInit() if the * re-transmission time interval reaches ipconfigMAXIMUM_DISCOVER_TX_PERIOD without * a DHCP reply being received. */ -#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD \ - ( 120000U / portTICK_PERIOD_MS ) +#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD pdMS_TO_TICKS( 120000U ) /* The ARP cache is a table that maps IP addresses to MAC addresses. The IP * stack can only send a UDP message to a remove IP address if it knowns the MAC @@ -160,19 +159,19 @@ * cache then the UDP message is replaced by a ARP message that solicits the * required MAC address information. ipconfigARP_CACHE_ENTRIES defines the maximum * number of entries that can exist in the ARP table at any one time. */ -#define ipconfigARP_CACHE_ENTRIES 6 +#define ipconfigARP_CACHE_ENTRIES 6 /* ARP requests that do not result in an ARP response will be re-transmitted a * maximum of ipconfigMAX_ARP_RETRANSMISSIONS times before the ARP request is * aborted. */ -#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) +#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) /* ipconfigMAX_ARP_AGE defines the maximum time between an entry in the ARP * table being created or refreshed and the entry being removed because it is stale. * New ARP requests are sent for ARP cache entries that are nearing their maximum * age. ipconfigMAX_ARP_AGE is specified in tens of seconds, so a value of 150 is * equal to 1500 seconds (or 25 minutes). */ -#define ipconfigMAX_ARP_AGE 150 +#define ipconfigMAX_ARP_AGE 150 /* Implementing FreeRTOS_inet_addr() necessitates the use of string handling * routines, which are relatively large. To save code space the full @@ -184,13 +183,13 @@ * ipconfigINCLUDE_FULL_INET_ADDR is set to 1 then both FreeRTOS_inet_addr() and * FreeRTOS_indet_addr_quick() are available. If ipconfigINCLUDE_FULL_INET_ADDR is * not set to 1 then only FreeRTOS_indet_addr_quick() is available. */ -#define ipconfigINCLUDE_FULL_INET_ADDR 1 +#define ipconfigINCLUDE_FULL_INET_ADDR 1 /* ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS defines the total number of network buffer that * are available to the IP stack. The total number of network buffers is limited * to ensure the total amount of RAM that can be consumed by the IP stack is capped * to a pre-determinable value. */ -#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 +#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 /* A FreeRTOS queue is used to send events from application tasks to the IP * stack. ipconfigEVENT_QUEUE_LENGTH sets the maximum number of events that can diff --git a/test/unit-test/FreeRTOS_TCP_IP_DiffConfig/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_TCP_IP_DiffConfig/FreeRTOSIPConfig.h index 4815614c7a..b846d94d1d 100644 --- a/test/unit-test/FreeRTOS_TCP_IP_DiffConfig/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_TCP_IP_DiffConfig/FreeRTOSIPConfig.h @@ -116,10 +116,9 @@ * maximum allowable send block time prevents prevents a deadlock occurring when * all the network buffers are in use and the tasks that process (and subsequently * free) the network buffers are themselves blocked waiting for a network buffer. - * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in - * milliseconds can be converted to a time in ticks by dividing the time in - * milliseconds by portTICK_PERIOD_MS. */ -#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS ( 5000U / portTICK_PERIOD_MS ) + * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in + * milliseconds can be converted to a time in ticks using pdMS_TO_TICKS().*/ +#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS pdMS_TO_TICKS( 5000U ) /* If ipconfigUSE_DHCP is 1 then FreeRTOS+TCP will attempt to retrieve an IP * address, netmask, DNS server address and gateway address from a DHCP server. If @@ -262,7 +261,7 @@ /* The windows simulator cannot really simulate MAC interrupts, and needs to * block occasionally to allow other tasks to run. */ -#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY ( 20 / portTICK_PERIOD_MS ) +#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY pdMS_TO_TICKS( 20 ) /* Advanced only: in order to access 32-bit fields in the IP packets with * 32-bit memory instructions, all packets will be stored 32-bit-aligned, diff --git a/test/unit-test/FreeRTOS_Tiny_TCP/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_Tiny_TCP/FreeRTOSIPConfig.h index 28f657715e..9221518b30 100644 --- a/test/unit-test/FreeRTOS_Tiny_TCP/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_Tiny_TCP/FreeRTOSIPConfig.h @@ -144,8 +144,7 @@ * static IP address passed as a parameter to FreeRTOS_IPInit() if the * re-transmission time interval reaches ipconfigMAXIMUM_DISCOVER_TX_PERIOD without * a DHCP reply being received. */ -#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD \ - ( 120000U / portTICK_PERIOD_MS ) +#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD pdMS_TO_TICKS( 120000U ) /* The ARP cache is a table that maps IP addresses to MAC addresses. The IP * stack can only send a UDP message to a remove IP address if it knowns the MAC @@ -156,19 +155,19 @@ * cache then the UDP message is replaced by a ARP message that solicits the * required MAC address information. ipconfigARP_CACHE_ENTRIES defines the maximum * number of entries that can exist in the ARP table at any one time. */ -#define ipconfigARP_CACHE_ENTRIES 6 +#define ipconfigARP_CACHE_ENTRIES 6 /* ARP requests that do not result in an ARP response will be re-transmitted a * maximum of ipconfigMAX_ARP_RETRANSMISSIONS times before the ARP request is * aborted. */ -#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) +#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 ) /* ipconfigMAX_ARP_AGE defines the maximum time between an entry in the ARP * table being created or refreshed and the entry being removed because it is stale. * New ARP requests are sent for ARP cache entries that are nearing their maximum * age. ipconfigMAX_ARP_AGE is specified in tens of seconds, so a value of 150 is * equal to 1500 seconds (or 25 minutes). */ -#define ipconfigMAX_ARP_AGE 150 +#define ipconfigMAX_ARP_AGE 150 /* Implementing FreeRTOS_inet_addr() necessitates the use of string handling * routines, which are relatively large. To save code space the full @@ -180,13 +179,13 @@ * ipconfigINCLUDE_FULL_INET_ADDR is set to 1 then both FreeRTOS_inet_addr() and * FreeRTOS_indet_addr_quick() are available. If ipconfigINCLUDE_FULL_INET_ADDR is * not set to 1 then only FreeRTOS_indet_addr_quick() is available. */ -#define ipconfigINCLUDE_FULL_INET_ADDR 1 +#define ipconfigINCLUDE_FULL_INET_ADDR 1 /* ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS defines the total number of network buffer that * are available to the IP stack. The total number of network buffers is limited * to ensure the total amount of RAM that can be consumed by the IP stack is capped * to a pre-determinable value. */ -#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 +#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 /* A FreeRTOS queue is used to send events from application tasks to the IP * stack. ipconfigEVENT_QUEUE_LENGTH sets the maximum number of events that can @@ -260,7 +259,7 @@ /* The windows simulator cannot really simulate MAC interrupts, and needs to * block occasionally to allow other tasks to run. */ -#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY ( 20 / portTICK_PERIOD_MS ) +#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY pdMS_TO_TICKS( 20 ) /* Advanced only: in order to access 32-bit fields in the IP packets with * 32-bit memory instructions, all packets will be stored 32-bit-aligned, diff --git a/test/unit-test/FreeRTOS_UDP_IPv4/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_UDP_IPv4/FreeRTOSIPConfig.h index 52819c5ae8..a438dea52a 100644 --- a/test/unit-test/FreeRTOS_UDP_IPv4/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_UDP_IPv4/FreeRTOSIPConfig.h @@ -151,7 +151,7 @@ * static IP address passed as a parameter to FreeRTOS_IPInit() if the * re-transmission time interval reaches ipconfigMAXIMUM_DISCOVER_TX_PERIOD without * a DHCP reply being received. */ -#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD ( 30000U / portTICK_PERIOD_MS ) +#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD pdMS_TO_TICKS( 30000U ) /* The ARP cache is a table that maps IP addresses to MAC addresses. The IP * stack can only send a UDP message to a remove IP address if it knowns the MAC diff --git a/test/unit-test/FreeRTOS_UDP_IPv6/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_UDP_IPv6/FreeRTOSIPConfig.h index 86da706217..40194734b6 100644 --- a/test/unit-test/FreeRTOS_UDP_IPv6/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_UDP_IPv6/FreeRTOSIPConfig.h @@ -120,10 +120,9 @@ * maximum allowable send block time prevents prevents a deadlock occurring when * all the network buffers are in use and the tasks that process (and subsequently * free) the network buffers are themselves blocked waiting for a network buffer. - * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in - * milliseconds can be converted to a time in ticks by dividing the time in - * milliseconds by portTICK_PERIOD_MS. */ -#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS ( 5000U / portTICK_PERIOD_MS ) + * ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks. A time in + * milliseconds can be converted to a time in ticks using pdMS_TO_TICKS().*/ +#define ipconfigUDP_MAX_SEND_BLOCK_TIME_TICKS pdMS_TO_TICKS( 5000U ) /* If ipconfigUSE_DHCP is 1 then FreeRTOS+TCP will attempt to retrieve an IP * address, netmask, DNS server address and gateway address from a DHCP server. If @@ -265,7 +264,7 @@ /* The windows simulator cannot really simulate MAC interrupts, and needs to * block occasionally to allow other tasks to run. */ -#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY ( 20 / portTICK_PERIOD_MS ) +#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY pdMS_TO_TICKS( 20 ) /* Advanced only: in order to access 32-bit fields in the IP packets with * 32-bit memory instructions, all packets will be stored 32-bit-aligned,