Skip to content

Commit a87ae5c

Browse files
committed
FreeRTOS v10.3.0
1 parent 80077ed commit a87ae5c

35 files changed

+709
-180
lines changed

ConwayLifePeggy/peggy2.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ void clear_data(uint32_t to[])
163163
void copy_old_new(uint32_t old_gen[], uint32_t new_gen[])
164164
{
165165
for(uint8_t temp = 0; temp < CELLS_X; temp++)
166-
old_generation[temp] = current_generation[temp];
166+
old_gen[temp] = new_gen[temp];
167167
return;
168168
}
169169

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Also, for the Arduino platform, there is an [Arduino freeRTOS Library](https://g
3030
available in the Arduino IDE Library manager, or by directly downloading the ZIP file and importing it into your Arduino IDE.
3131

3232
# Features
33-
- freeRTOS 10.1.1 implemented for selected AVR ATmega devices
33+
- freeRTOS 10.3.0 implemented for selected AVR ATmega devices
3434
- Arduino Uno, Pro, Mini, Nano, & LilyPad with ATmega328p supported
3535
- Arduino Mega (Seeed ADK, Freetronics EtherMega) with ATmega2560 supported
3636
- Goldilocks (Analogue) & Pololu Orangutan SVP with ATmega1284p supported

freeRTOS10xx/MemMang/heap_1.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* FreeRTOS Kernel V10.2.0
3-
* Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* FreeRTOS Kernel V10.3.0
3+
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
44
*
55
* Permission is hereby granted, free of charge, to any person obtaining a copy of
66
* this software and associated documentation files (the "Software"), to deal in

freeRTOS10xx/MemMang/heap_2.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* FreeRTOS Kernel V10.2.0
3-
* Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* FreeRTOS Kernel V10.3.0
3+
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
44
*
55
* Permission is hereby granted, free of charge, to any person obtaining a copy of
66
* this software and associated documentation files (the "Software"), to deal in

freeRTOS10xx/MemMang/heap_3.c

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* FreeRTOS Kernel V10.2.0
3-
* Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* FreeRTOS Kernel V10.3.0
3+
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
44
*
55
* Permission is hereby granted, free of charge, to any person obtaining a copy of
66
* this software and associated documentation files (the "Software"), to deal in
@@ -49,9 +49,7 @@ task.h is included from an application file. */
4949

5050
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
5151

52-
#if( configSUPPORT_DYNAMIC_ALLOCATION == 0 )
53-
#error This file must not be used if configSUPPORT_DYNAMIC_ALLOCATION is 0
54-
#endif
52+
#if( configSUPPORT_DYNAMIC_ALLOCATION > 0 )
5553

5654
/*-----------------------------------------------------------*/
5755

@@ -93,5 +91,4 @@ void vPortFree( void *pv )
9391
}
9492
}
9593

96-
97-
94+
#endif /* ( configSUPPORT_DYNAMIC_ALLOCATION > 0 ) */

freeRTOS10xx/MemMang/heap_4.c

+60-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* FreeRTOS Kernel V10.2.0
3-
* Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* FreeRTOS Kernel V10.3.0
3+
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
44
*
55
* Permission is hereby granted, free of charge, to any person obtaining a copy of
66
* this software and associated documentation files (the "Software"), to deal in
@@ -99,10 +99,12 @@ static const size_t xHeapStructSize = ( sizeof( BlockLink_t ) + ( ( size_t )
9999
/* Create a couple of list links to mark the start and end of the list. */
100100
static BlockLink_t xStart, *pxEnd = NULL;
101101

102-
/* Keeps track of the number of free bytes remaining, but says nothing about
103-
fragmentation. */
102+
/* Keeps track of the number of calls to allocate and free memory as well as the
103+
number of free bytes remaining, but says nothing about fragmentation. */
104104
static size_t xFreeBytesRemaining = 0U;
105105
static size_t xMinimumEverFreeBytesRemaining = 0U;
106+
static size_t xNumberOfSuccessfulAllocations = 0;
107+
static size_t xNumberOfSuccessfulFrees = 0;
106108

107109
/* Gets set to the top bit of an size_t type. When this bit in the xBlockSize
108110
member of an BlockLink_t structure is set then the block belongs to the
@@ -223,6 +225,7 @@ void *pvReturn = NULL;
223225
by the application and has no "next" block. */
224226
pxBlock->xBlockSize |= xBlockAllocatedBit;
225227
pxBlock->pxNextFreeBlock = NULL;
228+
xNumberOfSuccessfulAllocations++;
226229
}
227230
else
228231
{
@@ -294,6 +297,7 @@ BlockLink_t *pxLink;
294297
xFreeBytesRemaining += pxLink->xBlockSize;
295298
traceFREE( pv, pxLink->xBlockSize );
296299
prvInsertBlockIntoFreeList( ( ( BlockLink_t * ) pxLink ) );
300+
xNumberOfSuccessfulFrees++;
297301
}
298302
( void ) xTaskResumeAll();
299303
}
@@ -435,4 +439,56 @@ uint8_t *puc;
435439
mtCOVERAGE_TEST_MARKER();
436440
}
437441
}
442+
/*-----------------------------------------------------------*/
443+
444+
void vPortGetHeapStats( HeapStats_t *pxHeapStats )
445+
{
446+
BlockLink_t *pxBlock;
447+
size_t xBlocks = 0, xMaxSize = 0, xMinSize = portMAX_DELAY; /* portMAX_DELAY used as a portable way of getting the maximum value. */
448+
449+
vTaskSuspendAll();
450+
{
451+
pxBlock = xStart.pxNextFreeBlock;
452+
453+
/* pxBlock will be NULL if the heap has not been initialised. The heap
454+
is initialised automatically when the first allocation is made. */
455+
if( pxBlock != NULL )
456+
{
457+
do
458+
{
459+
/* Increment the number of blocks and record the largest block seen
460+
so far. */
461+
xBlocks++;
462+
463+
if( pxBlock->xBlockSize > xMaxSize )
464+
{
465+
xMaxSize = pxBlock->xBlockSize;
466+
}
467+
468+
if( pxBlock->xBlockSize < xMinSize )
469+
{
470+
xMinSize = pxBlock->xBlockSize;
471+
}
472+
473+
/* Move to the next block in the chain until the last block is
474+
reached. */
475+
pxBlock = pxBlock->pxNextFreeBlock;
476+
} while( pxBlock != pxEnd );
477+
}
478+
}
479+
xTaskResumeAll();
480+
481+
pxHeapStats->xSizeOfLargestFreeBlockInBytes = xMaxSize;
482+
pxHeapStats->xSizeOfSmallestFreeBlockInBytes = xMinSize;
483+
pxHeapStats->xNumberOfFreeBlocks = xBlocks;
484+
485+
taskENTER_CRITICAL();
486+
{
487+
pxHeapStats->xAvailableHeapSpaceInBytes = xFreeBytesRemaining;
488+
pxHeapStats->xNumberOfSuccessfulAllocations = xNumberOfSuccessfulAllocations;
489+
pxHeapStats->xNumberOfSuccessfulFrees = xNumberOfSuccessfulFrees;
490+
pxHeapStats->xMinimumEverFreeBytesRemaining = xMinimumEverFreeBytesRemaining;
491+
}
492+
taskEXIT_CRITICAL();
493+
}
438494

freeRTOS10xx/MemMang/heap_5.c

+66-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* FreeRTOS Kernel V10.2.0
3-
* Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* FreeRTOS Kernel V10.3.0
3+
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
44
*
55
* Permission is hereby granted, free of charge, to any person obtaining a copy of
66
* this software and associated documentation files (the "Software"), to deal in
@@ -116,10 +116,12 @@ static const size_t xHeapStructSize = ( sizeof( BlockLink_t ) + ( ( size_t )
116116
/* Create a couple of list links to mark the start and end of the list. */
117117
static BlockLink_t xStart, *pxEnd = NULL;
118118

119-
/* Keeps track of the number of free bytes remaining, but says nothing about
120-
fragmentation. */
119+
/* Keeps track of the number of calls to allocate and free memory as well as the
120+
number of free bytes remaining, but says nothing about fragmentation. */
121121
static size_t xFreeBytesRemaining = 0U;
122122
static size_t xMinimumEverFreeBytesRemaining = 0U;
123+
static size_t xNumberOfSuccessfulAllocations = 0;
124+
static size_t xNumberOfSuccessfulFrees = 0;
123125

124126
/* Gets set to the top bit of an size_t type. When this bit in the xBlockSize
125127
member of an BlockLink_t structure is set then the block belongs to the
@@ -231,6 +233,7 @@ void *pvReturn = NULL;
231233
by the application and has no "next" block. */
232234
pxBlock->xBlockSize |= xBlockAllocatedBit;
233235
pxBlock->pxNextFreeBlock = NULL;
236+
xNumberOfSuccessfulAllocations++;
234237
}
235238
else
236239
{
@@ -301,6 +304,7 @@ BlockLink_t *pxLink;
301304
xFreeBytesRemaining += pxLink->xBlockSize;
302305
traceFREE( pv, pxLink->xBlockSize );
303306
prvInsertBlockIntoFreeList( ( ( BlockLink_t * ) pxLink ) );
307+
xNumberOfSuccessfulFrees++;
304308
}
305309
( void ) xTaskResumeAll();
306310
}
@@ -482,4 +486,62 @@ const HeapRegion_t *pxHeapRegion;
482486
/* Work out the position of the top bit in a size_t variable. */
483487
xBlockAllocatedBit = ( ( size_t ) 1 ) << ( ( sizeof( size_t ) * heapBITS_PER_BYTE ) - 1 );
484488
}
489+
/*-----------------------------------------------------------*/
490+
491+
void vPortGetHeapStats( HeapStats_t *pxHeapStats )
492+
{
493+
BlockLink_t *pxBlock;
494+
size_t xBlocks = 0, xMaxSize = 0, xMinSize = portMAX_DELAY; /* portMAX_DELAY used as a portable way of getting the maximum value. */
495+
496+
vTaskSuspendAll();
497+
{
498+
pxBlock = xStart.pxNextFreeBlock;
499+
500+
/* pxBlock will be NULL if the heap has not been initialised. The heap
501+
is initialised automatically when the first allocation is made. */
502+
if( pxBlock != NULL )
503+
{
504+
do
505+
{
506+
/* Increment the number of blocks and record the largest block seen
507+
so far. */
508+
xBlocks++;
509+
510+
if( pxBlock->xBlockSize > xMaxSize )
511+
{
512+
xMaxSize = pxBlock->xBlockSize;
513+
}
514+
515+
/* Heap five will have a zero sized block at the end of each
516+
each region - the block is only used to link to the next
517+
heap region so it not a real block. */
518+
if( pxBlock->xBlockSize != 0 )
519+
{
520+
if( pxBlock->xBlockSize < xMinSize )
521+
{
522+
xMinSize = pxBlock->xBlockSize;
523+
}
524+
}
525+
526+
/* Move to the next block in the chain until the last block is
527+
reached. */
528+
pxBlock = pxBlock->pxNextFreeBlock;
529+
} while( pxBlock != pxEnd );
530+
}
531+
}
532+
xTaskResumeAll();
533+
534+
pxHeapStats->xSizeOfLargestFreeBlockInBytes = xMaxSize;
535+
pxHeapStats->xSizeOfSmallestFreeBlockInBytes = xMinSize;
536+
pxHeapStats->xNumberOfFreeBlocks = xBlocks;
537+
538+
taskENTER_CRITICAL();
539+
{
540+
pxHeapStats->xAvailableHeapSpaceInBytes = xFreeBytesRemaining;
541+
pxHeapStats->xNumberOfSuccessfulAllocations = xNumberOfSuccessfulAllocations;
542+
pxHeapStats->xNumberOfSuccessfulFrees = xNumberOfSuccessfulFrees;
543+
pxHeapStats->xMinimumEverFreeBytesRemaining = xMinimumEverFreeBytesRemaining;
544+
}
545+
taskEXIT_CRITICAL();
546+
}
485547

freeRTOS10xx/croutine.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* FreeRTOS Kernel V10.2.0
3-
* Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* FreeRTOS Kernel V10.3.0
3+
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
44
*
55
* Permission is hereby granted, free of charge, to any person obtaining a copy of
66
* this software and associated documentation files (the "Software"), to deal in

freeRTOS10xx/event_groups.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* FreeRTOS Kernel V10.2.0
3-
* Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* FreeRTOS Kernel V10.3.0
3+
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
44
*
55
* Permission is hereby granted, free of charge, to any person obtaining a copy of
66
* this software and associated documentation files (the "Software"), to deal in

0 commit comments

Comments
 (0)