Skip to content

Commit f8a9117

Browse files
committed
update to 10.4.6 - 7 August 2022 snapshot (LTS)
1 parent 536fba8 commit f8a9117

25 files changed

+1766
-1375
lines changed

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=FreeRTOS
2-
version=10.4.6-6
2+
version=10.4.6-7
33
author=Richard Barry <[email protected]>
44
maintainer=Phillip Stevens <[email protected]>
55
sentence=<h3>FreeRTOS Real Time Operating System implemented for AVR (Uno, Nano, Leonardo, Mega).</h3>

readme.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ My other [AVRfreeRTOS Sourceforge Repository](https://sourceforge.net/projects/a
1313

1414
This library was the genesis of [generalised support for the ATmega platform within FreeRTOS](https://github.com/FreeRTOS/FreeRTOS-Kernel/pull/48).
1515

16-
Over the past few years freeRTOS development has become increasingly 32-bit orientated, with little change or improvement for the 8-bit world. As such I'm treating this 1st January 2022 10.4.6 snapshot as my LTS release.
16+
Over the past few years freeRTOS development has become increasingly 32-bit orientated, with little change or improvement for the 8-bit world. As such I'm treating this 1st January 2022 10.4.6 snapshot as my LTS release. Bugfixes to 7th August 2022 have been added.
1717

1818
## General
1919

@@ -112,7 +112,6 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
112112
<td align="center"><a href="https://www.blackleg.es/"><img src="https://avatars1.githubusercontent.com/u/4323228" width="100px;" alt=""/><br /><sub><b>Hector Espert</b></sub></a><br /><a title="Code">💻</a></td>
113113
<td align="center"><a href="https://github.com/Floessie"><img src="https://avatars1.githubusercontent.com/u/10133457" width="100px;" alt=""/><br /><sub><b>Floessie</b></sub></a><br /><a title="Code">💻</a></td>
114114
<td align="center"><a href="https://github.com/Derekduke"><img src="https://avatars2.githubusercontent.com/u/30068270" width="100px;" alt=""/><br /><sub><b>Derekduke</b></sub></a><br /><a title="Code">💻</a></td>
115-
<td align="center"><a href="https://github.com/ianfixes"><img src="https://avatars.githubusercontent.com/u/583459" width="100px;" alt=""/><br /><sub><b>Ian</b></sub></a><br /><a title="Code">💻</a></td>
116115
<td align="center"><a href="https://github.com/balaji"><img src="https://avatars2.githubusercontent.com/u/29356302" width="100px;" alt=""/><br /><sub><b>Balaji.V</b></sub></a><br /><a title="Code">💻</a></td>
117116
</tr>
118117
</table>

src/Arduino_FreeRTOS.h

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,10 @@
320320
#define pcQueueGetName( xQueue )
321321
#endif
322322

323+
#ifndef configUSE_MINI_LIST_ITEM
324+
#define configUSE_MINI_LIST_ITEM 1
325+
#endif
326+
323327
#ifndef portPOINTER_SIZE_TYPE
324328
#define portPOINTER_SIZE_TYPE uint32_t
325329
#endif
@@ -872,6 +876,12 @@
872876
#define configUSE_POSIX_ERRNO 0
873877
#endif
874878

879+
#ifndef configUSE_SB_COMPLETED_CALLBACK
880+
881+
/* By default per-instance callbacks are not enabled for stream buffer or message buffer. */
882+
#define configUSE_SB_COMPLETED_CALLBACK 0
883+
#endif
884+
875885
#ifndef portTICK_TYPE_IS_ATOMIC
876886
#define portTICK_TYPE_IS_ATOMIC 0
877887
#endif
@@ -1125,16 +1135,20 @@ struct xSTATIC_LIST_ITEM
11251135
};
11261136
typedef struct xSTATIC_LIST_ITEM StaticListItem_t;
11271137

1128-
/* See the comments above the struct xSTATIC_LIST_ITEM definition. */
1129-
struct xSTATIC_MINI_LIST_ITEM
1130-
{
1131-
#if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )
1132-
TickType_t xDummy1;
1133-
#endif
1134-
TickType_t xDummy2;
1135-
void * pvDummy3[ 2 ];
1136-
};
1137-
typedef struct xSTATIC_MINI_LIST_ITEM StaticMiniListItem_t;
1138+
#if ( configUSE_MINI_LIST_ITEM == 1 )
1139+
/* See the comments above the struct xSTATIC_LIST_ITEM definition. */
1140+
struct xSTATIC_MINI_LIST_ITEM
1141+
{
1142+
#if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )
1143+
TickType_t xDummy1;
1144+
#endif
1145+
TickType_t xDummy2;
1146+
void * pvDummy3[ 2 ];
1147+
};
1148+
typedef struct xSTATIC_MINI_LIST_ITEM StaticMiniListItem_t;
1149+
#else /* if ( configUSE_MINI_LIST_ITEM == 1 ) */
1150+
typedef struct xSTATIC_LIST_ITEM StaticMiniListItem_t;
1151+
#endif /* if ( configUSE_MINI_LIST_ITEM == 1 ) */
11381152

11391153
/* See the comments above the struct xSTATIC_LIST_ITEM definition. */
11401154
typedef struct xSTATIC_LIST
@@ -1333,6 +1347,9 @@ typedef struct xSTATIC_STREAM_BUFFER
13331347
#if ( configUSE_TRACE_FACILITY == 1 )
13341348
UBaseType_t uxDummy4;
13351349
#endif
1350+
#if ( configUSE_SB_COMPLETED_CALLBACK == 1 )
1351+
void * pvDummy5[ 2 ];
1352+
#endif
13361353
} StaticStreamBuffer_t;
13371354

13381355
/* Message buffers are built on stream buffers. */

src/FreeRTOSConfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ to exclude the API function. */
100100
#define INCLUDE_vTaskDelay 1
101101
#define INCLUDE_xTaskGetSchedulerState 0
102102
#define INCLUDE_xTaskGetIdleTaskHandle 0 // create an idle task handle.
103-
#define INCLUDE_xTaskGetCurrentTaskHandle 0
103+
#define INCLUDE_xTaskGetCurrentTaskHandle 1
104104
#define INCLUDE_uxTaskGetStackHighWaterMark 1
105105

106106
#define configMAX(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a > _b ? _a : _b; })

src/History.txt

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,41 @@
1-
Changes between FreeRTOS V10.4.5 and V10.4.6
1+
Changes between FreeRTOS V10.4.6 and TBD
2+
3+
Documentation and download available at https://www.FreeRTOS.org/
4+
5+
+ Changed uxAutoReload parameter in timer functions to xAutoReload. The
6+
type is now BaseType_t. This matches the type of pdTRUE and pdFALSE.
7+
The new function xTimerGetAutoReload() provides the auto-reload state as
8+
a BaseType_t. The legacy function uxTimerGetAutoReload is retained with the
9+
original UBaseType_t return value.
10+
+ Introduce the configUSE_MINI_LIST_ITEM configuration option. When this
11+
option is set to 1, ListItem_t and MiniLitItem_t remain separate types.
12+
However, when configUSE_MINI_LIST_ITEM == 0, MiniLitItem_t and ListItem_t
13+
are both typedefs of the same struct xLIST_ITEM. This addresses some issues
14+
observed when strict-aliasing and link time optimization are enabled.
15+
To maintain backwards compatibility, configUSE_MINI_LIST_ITEM defaults to 1.
16+
+ Add the ability to override send and receive completed callbacks for each
17+
instance of a stream buffer or message buffer. The feature can be controlled
18+
by setting the configuration option configUSE_SB_COMPLETED_CALLBACK in
19+
FreeRTOSConfig.h. When the option is set to 1, APIs
20+
xStreamBufferCreateWithCallback() or xStreamBufferCreateStaticWithCallback()
21+
(and likewise APIs from message buffer) can be used to create a stream buffer
22+
or message buffer instance with application provided callback overrides. When
23+
the option is set to 0, then the default callbacks as defined by
24+
sbSEND_COMPLETED() and sbRECEIVE_COMPLETED() macros are invoked. To maintain
25+
backwards compatibility, configUSE_SB_COMPLETED_CALLBACK defaults to 0. The
26+
functionaility is currently not supported for MPU enabled ports.
27+
28+
Changes between FreeRTOS V10.4.5 and FreeRTOS V10.4.6 released November 12 2021
229

330
+ Extend use of the configSTACK_DEPTH_TYPE which enables developers to define
431
the type used to hold stack counter variables. Defaults to uint16_t
532
for backward compatibility. #define configSTACK_DEPTH_TYPE to a type
633
(for example, uint16_t) in FreeRTOSConfig.h to override the default.
734
+ Deleted all references to Coroutines.
8-
9-
Documentation and download available at https://www.FreeRTOS.org/
35+
+ Introduce a new config configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS which
36+
enables developers to prevent critical sections from unprivileged tasks.
37+
It defaults to 1 for backward compatibility. Application should set it to
38+
0 to disable critical sections from unprivileged tasks.
1039

1140
Changes between FreeRTOS V10.4.4 and FreeRTOS V10.4.5 released September 10 2021
1241

@@ -25,7 +54,7 @@ Changes between FreeRTOS V10.4.4 and FreeRTOS V10.4.5 released September 10 2021
2554
configIDLE_SHOULD_YIELD is set to 0.
2655
+ ARMv8-M secure-side port: Tasks that call secure functions from the
2756
non-secure side of an ARMv8-M MCU (ARM Cortex-M23 and Cortex-M33) have two
28-
contexts one on the non-secure side and one on the secure-side. Previous
57+
contexts - one on the non-secure side and one on the secure-side. Previous
2958
versions of the FreeRTOS ARMv8-M secure-side ports allocated the structures
3059
that reference secure-side contexts at run time. Now the structures are
3160
allocated statically at compile time. The change necessitates the

src/event_groups.c

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,13 @@ static BaseType_t prvTestWaitCondition( const EventBits_t uxCurrentEventBits,
101101
configASSERT( pxEventGroupBuffer );
102102

103103
#if ( configASSERT_DEFINED == 1 )
104-
{
105-
/* Sanity check that the size of the structure used to declare a
106-
* variable of type StaticEventGroup_t equals the size of the real
107-
* event group structure. */
108-
volatile size_t xSize = sizeof( StaticEventGroup_t );
109-
configASSERT( xSize == sizeof( EventGroup_t ) );
110-
} /*lint !e529 xSize is referenced if configASSERT() is defined. */
104+
{
105+
/* Sanity check that the size of the structure used to declare a
106+
* variable of type StaticEventGroup_t equals the size of the real
107+
* event group structure. */
108+
volatile size_t xSize = sizeof( StaticEventGroup_t );
109+
configASSERT( xSize == sizeof( EventGroup_t ) );
110+
} /*lint !e529 xSize is referenced if configASSERT() is defined. */
111111
#endif /* configASSERT_DEFINED */
112112

113113
/* The user has provided a statically allocated event group - use it. */
@@ -119,12 +119,12 @@ static BaseType_t prvTestWaitCondition( const EventBits_t uxCurrentEventBits,
119119
vListInitialise( &( pxEventBits->xTasksWaitingForBits ) );
120120

121121
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
122-
{
123-
/* Both static and dynamic allocation can be used, so note that
124-
* this event group was created statically in case the event group
125-
* is later deleted. */
126-
pxEventBits->ucStaticallyAllocated = pdTRUE;
127-
}
122+
{
123+
/* Both static and dynamic allocation can be used, so note that
124+
* this event group was created statically in case the event group
125+
* is later deleted. */
126+
pxEventBits->ucStaticallyAllocated = pdTRUE;
127+
}
128128
#endif /* configSUPPORT_DYNAMIC_ALLOCATION */
129129

130130
traceEVENT_GROUP_CREATE( pxEventBits );
@@ -170,12 +170,12 @@ static BaseType_t prvTestWaitCondition( const EventBits_t uxCurrentEventBits,
170170
vListInitialise( &( pxEventBits->xTasksWaitingForBits ) );
171171

172172
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
173-
{
174-
/* Both static and dynamic allocation can be used, so note this
175-
* event group was allocated statically in case the event group is
176-
* later deleted. */
177-
pxEventBits->ucStaticallyAllocated = pdFALSE;
178-
}
173+
{
174+
/* Both static and dynamic allocation can be used, so note this
175+
* event group was allocated statically in case the event group is
176+
* later deleted. */
177+
pxEventBits->ucStaticallyAllocated = pdFALSE;
178+
}
179179
#endif /* configSUPPORT_STATIC_ALLOCATION */
180180

181181
traceEVENT_GROUP_CREATE( pxEventBits );
@@ -204,9 +204,9 @@ EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup,
204204
configASSERT( ( uxBitsToWaitFor & eventEVENT_BITS_CONTROL_BYTES ) == 0 );
205205
configASSERT( uxBitsToWaitFor != 0 );
206206
#if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
207-
{
208-
configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
209-
}
207+
{
208+
configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
209+
}
210210
#endif
211211

212212
vTaskSuspendAll();
@@ -331,9 +331,9 @@ EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
331331
configASSERT( ( uxBitsToWaitFor & eventEVENT_BITS_CONTROL_BYTES ) == 0 );
332332
configASSERT( uxBitsToWaitFor != 0 );
333333
#if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
334-
{
335-
configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
336-
}
334+
{
335+
configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
336+
}
337337
#endif
338338

339339
vTaskSuspendAll();
@@ -645,29 +645,29 @@ void vEventGroupDelete( EventGroupHandle_t xEventGroup )
645645
configASSERT( pxTasksWaitingForBits->xListEnd.pxNext != ( const ListItem_t * ) &( pxTasksWaitingForBits->xListEnd ) );
646646
vTaskRemoveFromUnorderedEventList( pxTasksWaitingForBits->xListEnd.pxNext, eventUNBLOCKED_DUE_TO_BIT_SET );
647647
}
648-
649-
#if ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 0 ) )
650-
{
651-
/* The event group can only have been allocated dynamically - free
652-
* it again. */
653-
vPortFree( pxEventBits );
654-
}
655-
#elif ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) )
656-
{
657-
/* The event group could have been allocated statically or
658-
* dynamically, so check before attempting to free the memory. */
659-
if( pxEventBits->ucStaticallyAllocated == ( uint8_t ) pdFALSE )
660-
{
661-
vPortFree( pxEventBits );
662-
}
663-
else
664-
{
665-
mtCOVERAGE_TEST_MARKER();
666-
}
667-
}
668-
#endif /* configSUPPORT_DYNAMIC_ALLOCATION */
669648
}
670649
( void ) xTaskResumeAll();
650+
651+
#if ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 0 ) )
652+
{
653+
/* The event group can only have been allocated dynamically - free
654+
* it again. */
655+
vPortFree( pxEventBits );
656+
}
657+
#elif ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) )
658+
{
659+
/* The event group could have been allocated statically or
660+
* dynamically, so check before attempting to free the memory. */
661+
if( pxEventBits->ucStaticallyAllocated == ( uint8_t ) pdFALSE )
662+
{
663+
vPortFree( pxEventBits );
664+
}
665+
else
666+
{
667+
mtCOVERAGE_TEST_MARKER();
668+
}
669+
}
670+
#endif /* configSUPPORT_DYNAMIC_ALLOCATION */
671671
}
672672
/*-----------------------------------------------------------*/
673673

src/event_groups.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@
6565
* be set and then tested atomically - as is the case where event groups are
6666
* used to create a synchronisation point between multiple tasks (a
6767
* 'rendezvous').
68-
*
69-
* \defgroup EventGroup
7068
*/
7169

7270

@@ -243,7 +241,8 @@ typedef TickType_t EventBits_t;
243241
*
244242
* @param xTicksToWait The maximum amount of time (specified in 'ticks') to wait
245243
* for one/all (depending on the xWaitForAllBits value) of the bits specified by
246-
* uxBitsToWaitFor to become set.
244+
* uxBitsToWaitFor to become set. A value of portMAX_DELAY can be used to block
245+
* indefinitely (provided INCLUDE_vTaskSuspend is set to 1 in FreeRTOSConfig.h).
247246
*
248247
* @return The value of the event group at the time either the bits being waited
249248
* for became set, or the block time expired. Test the return value to know
@@ -377,6 +376,12 @@ EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup,
377376
* timer task to have the clear operation performed in the context of the timer
378377
* task.
379378
*
379+
* @note If this function returns pdPASS then the timer task is ready to run
380+
* and a portYIELD_FROM_ISR(pdTRUE) should be executed to perform the needed
381+
* clear on the event group. This behavior is different from
382+
* xEventGroupSetBitsFromISR because the parameter xHigherPriorityTaskWoken is
383+
* not present.
384+
*
380385
* @param xEventGroup The event group in which the bits are to be cleared.
381386
*
382387
* @param uxBitsToClear A bitwise value that indicates the bit or bits to clear.
@@ -406,6 +411,7 @@ EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup,
406411
* if( xResult == pdPASS )
407412
* {
408413
* // The message was posted successfully.
414+
* portYIELD_FROM_ISR(pdTRUE);
409415
* }
410416
* }
411417
* @endcode

src/heap_3.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,12 @@ void * pvPortMalloc( size_t xWantedSize )
6666
( void ) xTaskResumeAll();
6767

6868
#if ( configUSE_MALLOC_FAILED_HOOK == 1 )
69+
{
70+
if( pvReturn == NULL )
6971
{
70-
if( pvReturn == NULL )
71-
{
72-
extern void vApplicationMallocFailedHook( void );
73-
vApplicationMallocFailedHook();
74-
}
72+
vApplicationMallocFailedHook();
7573
}
74+
}
7675
#endif
7776

7877
return pvReturn;
@@ -81,7 +80,7 @@ void * pvPortMalloc( size_t xWantedSize )
8180

8281
void vPortFree( void * pv )
8382
{
84-
if( pv )
83+
if( pv != NULL )
8584
{
8685
vTaskSuspendAll();
8786
{

src/list.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ void vListInitialise( List_t * const pxList )
5454
* as the only list entry. */
5555
pxList->pxIndex = ( ListItem_t * ) &( pxList->xListEnd ); /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. */
5656

57+
listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( &( pxList->xListEnd ) );
58+
5759
/* The list end value is the highest possible value in the list to
5860
* ensure it remains at the end of the list. */
5961
pxList->xListEnd.xItemValue = portMAX_DELAY;
@@ -63,6 +65,15 @@ void vListInitialise( List_t * const pxList )
6365
pxList->xListEnd.pxNext = ( ListItem_t * ) &( pxList->xListEnd ); /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. */
6466
pxList->xListEnd.pxPrevious = ( ListItem_t * ) &( pxList->xListEnd ); /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. */
6567

68+
/* Initialize the remaining fields of xListEnd when it is a proper ListItem_t */
69+
#if ( configUSE_MINI_LIST_ITEM == 0 )
70+
{
71+
pxList->xListEnd.pvOwner = NULL;
72+
pxList->xListEnd.pxContainer = NULL;
73+
listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( &( pxList->xListEnd ) );
74+
}
75+
#endif
76+
6677
pxList->uxNumberOfItems = ( UBaseType_t ) 0U;
6778

6879
/* Write known values into the list if

0 commit comments

Comments
 (0)