diff --git a/FreeRTOS/Demo/WIN32-MingW/FreeRTOSConfig.h b/FreeRTOS/Demo/WIN32-MingW/FreeRTOSConfig.h index 7fded6bc37..d625c7965a 100644 --- a/FreeRTOS/Demo/WIN32-MingW/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/WIN32-MingW/FreeRTOSConfig.h @@ -48,7 +48,6 @@ #define configTOTAL_HEAP_SIZE ( ( size_t ) ( 100 * 1024 ) ) #define configMAX_TASK_NAME_LEN ( 12 ) #define configUSE_TRACE_FACILITY 1 -#define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 #define configUSE_MUTEXES 1 #define configCHECK_FOR_STACK_OVERFLOW 0 @@ -61,6 +60,14 @@ #define configUSE_TASK_NOTIFICATIONS 1 #define configSUPPORT_STATIC_ALLOCATION 1 +/* Tick type width is defined based on the compiler type (32bit or 64bit). */ +#ifdef __x86_64__ + #define configTICK_TYPE_WIDTH_IN_BITS TICK_TYPE_WIDTH_64_BITS +#else + #define configTICK_TYPE_WIDTH_IN_BITS TICK_TYPE_WIDTH_32_BITS +#endif + + /* Software timer related configuration options. The maximum possible task priority is configMAX_PRIORITIES - 1. The priority of the timer task is deliberately set higher to ensure it is correctly capped back to @@ -135,7 +142,11 @@ used with multiple project configurations. If it is #define mtCOVERAGE_TEST_MARKER() __asm volatile( "NOP" ) /* Ensure the tick count overflows during the coverage test. */ - #define configINITIAL_TICK_COUNT 0xffffd800UL + #if( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_64_BITS ) + #define configINITIAL_TICK_COUNT 0xffffffffffffd800ULL + #else + #define configINITIAL_TICK_COUNT 0xffffd800UL + #endif /* Allows tests of trying to allocate more than the heap has free. */ #define configUSE_MALLOC_FAILED_HOOK 0 diff --git a/FreeRTOS/Demo/WIN32-MingW/code_coverage_additions.c b/FreeRTOS/Demo/WIN32-MingW/code_coverage_additions.c index 6071367481..7072feefcc 100644 --- a/FreeRTOS/Demo/WIN32-MingW/code_coverage_additions.c +++ b/FreeRTOS/Demo/WIN32-MingW/code_coverage_additions.c @@ -86,50 +86,50 @@ static BaseType_t prvTimerQuery( void ); static BaseType_t prvStaticAllocationsWithNullBuffers( void ) { -uint32_t ulReturned = 0; +UBaseType_t uxReturned = 0; BaseType_t xReturn = pdPASS; UBaseType_t uxDummy = 10; /* Don't expect to create any of the objects as a NULL parameter is always passed in place of a required buffer. Hence if all passes then none of the - |= will be against 0, and ulReturned will still be zero at the end of this + |= will be against 0, and uxReturned will still be zero at the end of this function. */ - ulReturned |= ( uint32_t ) xEventGroupCreateStatic( NULL ); + uxReturned |= ( UBaseType_t ) xEventGroupCreateStatic( NULL ); /* Try creating a task twice, once with puxStackBuffer NULL, and once with pxTaskBuffer NULL. */ - ulReturned |= ( uint32_t ) xTaskCreateStatic( NULL, /* Task to run, not needed as the task is not created. */ - "Dummy", /* Task name. */ - configMINIMAL_STACK_SIZE, - NULL, - tskIDLE_PRIORITY, - NULL, - ( StaticTask_t * ) &xReturn ); /* Dummy value just to pass a non NULL value in - won't get used. */ - - ulReturned |= ( uint32_t ) xTaskCreateStatic( NULL, /* Task to run, not needed as the task is not created. */ - "Dummy", /* Task name. */ - configMINIMAL_STACK_SIZE, - NULL, - tskIDLE_PRIORITY, - ( StackType_t * ) &xReturn, /* Dummy value just to pass a non NULL value in - won't get used. */ - NULL ); - - ulReturned |= ( uint32_t ) xQueueCreateStatic( uxDummy, - uxDummy, - ( uint8_t * ) &xReturn, /* Dummy value just to pass a non NULL value in - won't get used. */ - NULL ); + uxReturned |= ( UBaseType_t ) xTaskCreateStatic( NULL, /* Task to run, not needed as the task is not created. */ + "Dummy", /* Task name. */ + configMINIMAL_STACK_SIZE, + NULL, + tskIDLE_PRIORITY, + NULL, + ( StaticTask_t * ) &xReturn ); /* Dummy value just to pass a non NULL value in - won't get used. */ + + uxReturned |= ( UBaseType_t ) xTaskCreateStatic( NULL, /* Task to run, not needed as the task is not created. */ + "Dummy", /* Task name. */ + configMINIMAL_STACK_SIZE, + NULL, + tskIDLE_PRIORITY, + ( StackType_t * ) &xReturn, /* Dummy value just to pass a non NULL value in - won't get used. */ + NULL ); + + uxReturned |= ( UBaseType_t ) xQueueCreateStatic( uxDummy, + uxDummy, + ( uint8_t * ) &xReturn, /* Dummy value just to pass a non NULL value in - won't get used. */ + NULL ); /* Try creating a stream buffer twice, once with pucStreamBufferStorageArea set to NULL, and once with pxStaticStreamBuffer set to NULL. */ - ulReturned |= ( uint32_t ) xStreamBufferCreateStatic( uxDummy, - uxDummy, - NULL, - ( StaticStreamBuffer_t * ) &xReturn ); /* Dummy value just to pass a non NULL value in - won't get used. */ + uxReturned |= ( UBaseType_t ) xStreamBufferCreateStatic( uxDummy, + uxDummy, + NULL, + ( StaticStreamBuffer_t * ) &xReturn ); /* Dummy value just to pass a non NULL value in - won't get used. */ - ulReturned |= ( uint32_t ) xStreamBufferCreateStatic( uxDummy, - uxDummy, - ( uint8_t * ) &xReturn, /* Dummy value just to pass a non NULL value in - won't get used. */ - NULL ); + uxReturned |= ( UBaseType_t ) xStreamBufferCreateStatic( uxDummy, + uxDummy, + ( uint8_t * ) &xReturn, /* Dummy value just to pass a non NULL value in - won't get used. */ + NULL ); /* Try to create a task with a stack that is too large to be allocated. */ if( xTaskCreate( NULL, "TooLarge", configTOTAL_HEAP_SIZE, NULL, tskIDLE_PRIORITY, NULL ) != errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY ) @@ -137,7 +137,7 @@ UBaseType_t uxDummy = 10; xReturn = pdFAIL; } - if( ulReturned != 0 ) + if( uxReturned != 0 ) { /* Something returned a non-NULL value. */ xReturn = pdFAIL; diff --git a/FreeRTOS/Demo/WIN32-MingW/main_full.c b/FreeRTOS/Demo/WIN32-MingW/main_full.c index 0eae31e8c4..1b7d603aff 100644 --- a/FreeRTOS/Demo/WIN32-MingW/main_full.c +++ b/FreeRTOS/Demo/WIN32-MingW/main_full.c @@ -386,19 +386,21 @@ static void prvCheckTask( void * pvParameters ) #endif /* configSUPPORT_STATIC_ALLOCATION */ /* This is the only task that uses stdout so its ok to call printf() - * directly. */ + * directly. %llu (long long unsigned) format specifier is used here + * to support both 32-bit values on MinGW32 and 64-bit values on + * MinGW64. */ vPortGetHeapStats( &xHeapStats ); configASSERT( xHeapStats.xAvailableHeapSpaceInBytes == xPortGetFreeHeapSize() ); configASSERT( xHeapStats.xMinimumEverFreeBytesRemaining == xPortGetMinimumEverFreeHeapSize() ); - printf( "%s - tick count %u - free heap %u - min free heap %u - largest free block %u - number of free blocks %u\r\n", + printf( "%s - tick count %llu - free heap %llu - min free heap %llu - largest free block %llu - number of free blocks %llu\r\n", pcStatusMessage, - xTaskGetTickCount(), - xHeapStats.xAvailableHeapSpaceInBytes, - xHeapStats.xMinimumEverFreeBytesRemaining, - xHeapStats.xSizeOfLargestFreeBlockInBytes, - xHeapStats.xNumberOfFreeBlocks ); + ( uint64_t ) xTaskGetTickCount(), + ( uint64_t ) xHeapStats.xAvailableHeapSpaceInBytes, + ( uint64_t ) xHeapStats.xMinimumEverFreeBytesRemaining, + ( uint64_t ) xHeapStats.xSizeOfLargestFreeBlockInBytes, + ( uint64_t ) xHeapStats.xNumberOfFreeBlocks ); fflush( stdout ); } @@ -554,21 +556,22 @@ void vFullDemoTickHookFunction( void ) static void prvPendedFunction( void * pvParameter1, uint32_t ulParameter2 ) { - static uint32_t ulLastParameter1 = 1000UL, ulLastParameter2 = 0UL; - uint32_t ulParameter1; + static UBaseType_t uxLastParameter1 = 1000UL; + static uint32_t ulLastParameter2 = 0UL; + UBaseType_t uxParameter1; - ulParameter1 = ( uint32_t ) pvParameter1; + uxParameter1 = ( UBaseType_t ) pvParameter1; /* Ensure the parameters are as expected. */ - configASSERT( ulParameter1 == ( ulLastParameter1 + 1 ) ); + configASSERT( uxParameter1 == ( uxLastParameter1 + 1 ) ); configASSERT( ulParameter2 == ( ulLastParameter2 + 1 ) ); /* Remember the parameters for the next time the function is called. */ - ulLastParameter1 = ulParameter1; + uxLastParameter1 = uxParameter1; ulLastParameter2 = ulParameter2; /* Remove compiler warnings in case configASSERT() is not defined. */ - ( void ) ulLastParameter1; + ( void ) uxLastParameter1; ( void ) ulLastParameter2; } /*-----------------------------------------------------------*/ @@ -622,17 +625,18 @@ static void prvDemonstrateTimerQueryFunctions( void ) static void prvDemonstratePendingFunctionCall( void ) { - static uint32_t ulParameter1 = 1000UL, ulParameter2 = 0UL; + static UBaseType_t uxParameter1 = 1000UL; + static uint32_t ulParameter2 = 0UL; const TickType_t xDontBlock = 0; /* This is called from the idle task so must *not* attempt to block. */ /* prvPendedFunction() just expects the parameters to be incremented by one * each time it is called. */ - ulParameter1++; + uxParameter1++; ulParameter2++; /* Pend the function call, sending the parameters. */ - xTimerPendFunctionCall( prvPendedFunction, ( void * ) ulParameter1, ulParameter2, xDontBlock ); + xTimerPendFunctionCall( prvPendedFunction, ( void * ) uxParameter1, ulParameter2, xDontBlock ); } /*-----------------------------------------------------------*/ @@ -869,12 +873,12 @@ static void prvPermanentlyBlockingNotificationTask( void * pvParameters ) static void prvReloadModeTestTimerCallback( TimerHandle_t xTimer ) { - uint32_t ulTimerID; + UBaseType_t uxTimerID; /* Increment the timer's ID to show the callback has executed. */ - ulTimerID = ( uint32_t ) pvTimerGetTimerID( xTimer ); - ulTimerID++; - vTimerSetTimerID( xTimer, ( void * ) ulTimerID ); + uxTimerID = ( UBaseType_t ) pvTimerGetTimerID( xTimer ); + uxTimerID++; + vTimerSetTimerID( xTimer, ( void * ) uxTimerID ); } /*-----------------------------------------------------------*/ @@ -906,7 +910,7 @@ static void prvDemonstrateChangingTimerReloadMode( void * pvParameters ) vTimerSetTimerID( xTimer, ( void * ) 0 ); xTimerStart( xTimer, portMAX_DELAY ); vTaskDelay( 3UL * x50ms ); - configASSERT( ( ( uint32_t ) ( pvTimerGetTimerID( xTimer ) ) ) == 1UL ); + configASSERT( ( ( UBaseType_t ) ( pvTimerGetTimerID( xTimer ) ) ) == 1UL ); /* Now change the timer to be an auto-reload timer and check it executes * the expected number of times. */ @@ -914,7 +918,7 @@ static void prvDemonstrateChangingTimerReloadMode( void * pvParameters ) vTimerSetTimerID( xTimer, ( void * ) 0 ); xTimerStart( xTimer, 0 ); vTaskDelay( ( 3UL * x50ms ) + ( x50ms / 2UL ) ); /* Three full periods. */ - configASSERT( ( uint32_t ) ( pvTimerGetTimerID( xTimer ) ) == 3UL ); + configASSERT( ( UBaseType_t ) ( pvTimerGetTimerID( xTimer ) ) == 3UL ); configASSERT( xTimerStop( xTimer, 0 ) != pdFAIL ); /* Now change the timer back to be a one-shot timer and check it only @@ -924,9 +928,10 @@ static void prvDemonstrateChangingTimerReloadMode( void * pvParameters ) xTimerStart( xTimer, 0 ); vTaskDelay( 3UL * x50ms ); configASSERT( xTimerStop( xTimer, 0 ) != pdFAIL ); - configASSERT( ( uint32_t ) ( pvTimerGetTimerID( xTimer ) ) == 1UL ); + configASSERT( ( UBaseType_t ) ( pvTimerGetTimerID( xTimer ) ) == 1UL ); /* Clean up at the end. */ xTimerDelete( xTimer, portMAX_DELAY ); vTaskDelete( NULL ); } +/*-----------------------------------------------------------*/ diff --git a/FreeRTOS/Source b/FreeRTOS/Source index 30f6061f48..625b24a104 160000 --- a/FreeRTOS/Source +++ b/FreeRTOS/Source @@ -1 +1 @@ -Subproject commit 30f6061f48e2d54625d31e72ada6f5c474fba99f +Subproject commit 625b24a104dd901d86759668b6b272590d154308 diff --git a/manifest.yml b/manifest.yml index 2e08c1c8c6..189ec037b4 100644 --- a/manifest.yml +++ b/manifest.yml @@ -5,7 +5,7 @@ license: "MIT" dependencies: - name: "FreeRTOS-Kernel" - version: "30f6061f4" + version: "625b24a10" repository: type: "git" url: "https://github.com/FreeRTOS/FreeRTOS-Kernel.git"