Compare commits

...

4 commits

Author SHA1 Message Date
Anubhav Rawal
a8c9d35152
Fix undefined behavior from signed left-shift in MSVC-MingW port (#1411)
Replace `( 1 << n )` with `( 1UL << n )` in all left-shift expressions
in portable/MSVC-MingW/port.c. Shifting a signed int by >= 31 is
undefined behavior per ISO C11 §6.5.7.
2026-05-06 16:11:51 -07:00
Ramesh
d1f551e253 - Fixed the wrong pre-processor comment and function parameters 2026-04-23 12:58:23 -07:00
Kody Stribrny
587fe6df0d Fix long path errors on Windows demos
Both the WIN32-MSVC and WIN32-MingW demos
are failing due to long file paths. This is
because of a transitive dependency path which is
submodules further extending the path length. Enabling
windows long path support fixes this.
2026-04-22 13:56:28 -07:00
1294644079@qq.com
5f2cc25b17 fix stream/message buffer type and timeout in example 2026-04-21 14:55:29 -07:00
5 changed files with 24 additions and 16 deletions

View file

@ -13,6 +13,10 @@ jobs:
name: WIN32 MSVC name: WIN32 MSVC
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- name: Enable long paths on Windows
if: runner.os == 'Windows'
run: git config --system core.longpaths true
- name: Checkout the FreeRTOS/FreeRTOS Repository - name: Checkout the FreeRTOS/FreeRTOS Repository
uses: actions/checkout@v4.1.1 uses: actions/checkout@v4.1.1
with: with:
@ -42,6 +46,10 @@ jobs:
name: WIN32 MingW name: WIN32 MingW
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- name: Enable long paths on Windows
if: runner.os == 'Windows'
run: git config --system core.longpaths true
- name: Checkout the FreeRTOS/FreeRTOS Repository - name: Checkout the FreeRTOS/FreeRTOS Repository
uses: actions/checkout@v4.1.1 uses: actions/checkout@v4.1.1
with: with:

View file

@ -92,7 +92,7 @@
*/ */
#ifndef configLIST_VOLATILE #ifndef configLIST_VOLATILE
#define configLIST_VOLATILE #define configLIST_VOLATILE
#endif /* configSUPPORT_CROSS_MODULE_OPTIMISATION */ #endif /* configLIST_VOLATILE */
/* *INDENT-OFF* */ /* *INDENT-OFF* */
#ifdef __cplusplus #ifdef __cplusplus
@ -191,7 +191,7 @@ typedef struct xLIST
* Access macro to get the owner of a list item. The owner of a list item * Access macro to get the owner of a list item. The owner of a list item
* is the object (usually a TCB) that contains the list item. * is the object (usually a TCB) that contains the list item.
* *
* \page listGET_LIST_ITEM_OWNER listSET_LIST_ITEM_OWNER * \page listGET_LIST_ITEM_OWNER listGET_LIST_ITEM_OWNER
* \ingroup LinkedList * \ingroup LinkedList
*/ */
#define listGET_LIST_ITEM_OWNER( pxListItem ) ( ( pxListItem )->pvOwner ) #define listGET_LIST_ITEM_OWNER( pxListItem ) ( ( pxListItem )->pvOwner )
@ -310,7 +310,7 @@ typedef struct xLIST
* Remove an item from a list. The list item has a pointer to the list that * Remove an item from a list. The list item has a pointer to the list that
* it is in, so only the list item need be passed into the function. * it is in, so only the list item need be passed into the function.
* *
* @param uxListRemove The item to be removed. The item will remove itself from * @param pxItemToRemove The item to be removed. The item will remove itself from
* the list pointed to by it's pxContainer parameter. * the list pointed to by it's pxContainer parameter.
* *
* @return The number of items that remain in the list after the list item has * @return The number of items that remain in the list after the list item has
@ -491,7 +491,7 @@ void vListInsertEnd( List_t * const pxList,
* Remove an item from a list. The list item has a pointer to the list that * Remove an item from a list. The list item has a pointer to the list that
* it is in, so only the list item need be passed into the function. * it is in, so only the list item need be passed into the function.
* *
* @param uxListRemove The item to be removed. The item will remove itself from * @param pxItemToRemove The item to be removed. The item will remove itself from
* the list pointed to by it's pxContainer parameter. * the list pointed to by it's pxContainer parameter.
* *
* @return The number of items that remain in the list after the list item has * @return The number of items that remain in the list after the list item has

View file

@ -560,14 +560,14 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
* *
* Example use: * Example use:
* @code{c} * @code{c}
* void vAFunction( MessageBuffer_t xMessageBuffer ) * void vAFunction( MessageBufferHandle_t xMessageBuffer )
* { * {
* uint8_t ucRxData[ 20 ]; * uint8_t ucRxData[ 20 ];
* size_t xReceivedBytes; * size_t xReceivedBytes;
* const TickType_t xBlockTime = pdMS_TO_TICKS( 20 ); * const TickType_t xBlockTime = pdMS_TO_TICKS( 20 );
* *
* // Receive the next message from the message buffer. Wait in the Blocked * // Receive the next message from the message buffer. Wait in the Blocked
* // state (so not using any CPU processing time) for a maximum of 100ms for * // state (so not using any CPU processing time) for a maximum of 20ms for
* // a message to become available. * // a message to become available.
* xReceivedBytes = xMessageBufferReceive( xMessageBuffer, * xReceivedBytes = xMessageBufferReceive( xMessageBuffer,
* ( void * ) ucRxData, * ( void * ) ucRxData,
@ -655,7 +655,7 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
* Example use: * Example use:
* @code{c} * @code{c}
* // A message buffer that has already been created. * // A message buffer that has already been created.
* MessageBuffer_t xMessageBuffer; * MessageBufferHandle_t xMessageBuffer;
* *
* void vAnInterruptServiceRoutine( void ) * void vAnInterruptServiceRoutine( void )
* { * {

View file

@ -760,7 +760,7 @@ size_t xStreamBufferSendFromISR( StreamBufferHandle_t xStreamBuffer,
* *
* Example use: * Example use:
* @code{c} * @code{c}
* void vAFunction( StreamBuffer_t xStreamBuffer ) * void vAFunction( StreamBufferHandle_t xStreamBuffer )
* { * {
* uint8_t ucRxData[ 20 ]; * uint8_t ucRxData[ 20 ];
* size_t xReceivedBytes; * size_t xReceivedBytes;
@ -768,7 +768,7 @@ size_t xStreamBufferSendFromISR( StreamBufferHandle_t xStreamBuffer,
* *
* // Receive up to another sizeof( ucRxData ) bytes from the stream buffer. * // Receive up to another sizeof( ucRxData ) bytes from the stream buffer.
* // Wait in the Blocked state (so not using any CPU processing time) for a * // Wait in the Blocked state (so not using any CPU processing time) for a
* // maximum of 100ms for the full sizeof( ucRxData ) number of bytes to be * // maximum of 20ms for the full sizeof( ucRxData ) number of bytes to be
* // available. * // available.
* xReceivedBytes = xStreamBufferReceive( xStreamBuffer, * xReceivedBytes = xStreamBufferReceive( xStreamBuffer,
* ( void * ) ucRxData, * ( void * ) ucRxData,
@ -840,7 +840,7 @@ size_t xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer,
* Example use: * Example use:
* @code{c} * @code{c}
* // A stream buffer that has already been created. * // A stream buffer that has already been created.
* StreamBuffer_t xStreamBuffer; * StreamBufferHandle_t xStreamBuffer;
* *
* void vAnInterruptServiceRoutine( void ) * void vAnInterruptServiceRoutine( void )
* { * {
@ -1218,7 +1218,7 @@ UBaseType_t uxStreamBufferGetStreamBufferNotificationIndex( StreamBufferHandle_t
* stream_buffer.h * stream_buffer.h
* *
* @code{c} * @code{c}
* void vStreamBufferSetStreamBufferNotificationIndex ( StreamBuffer_t xStreamBuffer, UBaseType_t uxNotificationIndex ); * void vStreamBufferSetStreamBufferNotificationIndex ( StreamBufferHandle_t xStreamBuffer, UBaseType_t uxNotificationIndex );
* @endcode * @endcode
* *
* Set the task notification index used for the supplied stream buffer. * Set the task notification index used for the supplied stream buffer.

View file

@ -408,7 +408,7 @@ static void prvProcessSimulatedInterrupts( void )
/* Create a pending tick to ensure the first task is started as soon as /* Create a pending tick to ensure the first task is started as soon as
* this thread pends. */ * this thread pends. */
ulPendingInterrupts |= ( 1 << portINTERRUPT_TICK ); ulPendingInterrupts |= ( 1UL << portINTERRUPT_TICK );
SetEvent( pvInterruptEvent ); SetEvent( pvInterruptEvent );
while( xPortRunning == pdTRUE ) while( xPortRunning == pdTRUE )
@ -447,7 +447,7 @@ static void prvProcessSimulatedInterrupts( void )
if( ulIsrHandler[ i ]() != pdFALSE ) if( ulIsrHandler[ i ]() != pdFALSE )
{ {
/* A bit mask is used purely to help debugging. */ /* A bit mask is used purely to help debugging. */
ulSwitchRequired |= ( 1 << i ); ulSwitchRequired |= ( 1UL << i );
} }
} }
@ -580,7 +580,7 @@ void vPortCloseRunningThread( void * pvTaskToDelete,
if( pvInterruptEventMutex != NULL ) if( pvInterruptEventMutex != NULL )
{ {
WaitForSingleObject( pvInterruptEventMutex, INFINITE ); WaitForSingleObject( pvInterruptEventMutex, INFINITE );
ulPendingInterrupts |= ( 1 << portINTERRUPT_YIELD ); ulPendingInterrupts |= ( 1UL << portINTERRUPT_YIELD );
ReleaseMutex( pvInterruptEventMutex ); ReleaseMutex( pvInterruptEventMutex );
} }
@ -604,7 +604,7 @@ void vPortGenerateSimulatedInterrupt( uint32_t ulInterruptNumber )
if( ( ulInterruptNumber < portMAX_INTERRUPTS ) && ( pvInterruptEventMutex != NULL ) ) if( ( ulInterruptNumber < portMAX_INTERRUPTS ) && ( pvInterruptEventMutex != NULL ) )
{ {
WaitForSingleObject( pvInterruptEventMutex, INFINITE ); WaitForSingleObject( pvInterruptEventMutex, INFINITE );
ulPendingInterrupts |= ( 1 << ulInterruptNumber ); ulPendingInterrupts |= ( 1UL << ulInterruptNumber );
/* The simulated interrupt is now held pending, but don't actually /* The simulated interrupt is now held pending, but don't actually
* process it yet if this call is within a critical section. It is * process it yet if this call is within a critical section. It is
@ -645,7 +645,7 @@ void vPortGenerateSimulatedInterruptFromWindowsThread( uint32_t ulInterruptNumbe
/* Pending a user defined interrupt to be handled in simulated interrupt /* Pending a user defined interrupt to be handled in simulated interrupt
* handler thread. */ * handler thread. */
ulPendingInterrupts |= ( 1 << ulInterruptNumber ); ulPendingInterrupts |= ( 1UL << ulInterruptNumber );
/* The interrupt is now pending - notify the simulated interrupt /* The interrupt is now pending - notify the simulated interrupt
* handler thread. Must be outside of a critical section to get here so * handler thread. Must be outside of a critical section to get here so