mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
FreeRTOS source changes:
+ heap_1.c and heap_2.c now support configAPPLICATION_ALLOCATED_HEAP (heap_4.c already did) which allows the heap to be placed by the user rather than the linker. Demo app changes: + SAMD20 project has been updated to use Atmel Studio 7.
This commit is contained in:
parent
e9561c946c
commit
fa86d4eece
|
@ -2,7 +2,7 @@
|
|||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectVersion>6.1</ProjectVersion>
|
||||
<ProjectVersion>7.0</ProjectVersion>
|
||||
<ProjectGuid>{2a475b6a-78b0-4237-8947-341bd379ab5c}</ProjectGuid>
|
||||
<Name>$(MSBuildProjectName)</Name>
|
||||
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
|
||||
|
@ -165,7 +165,7 @@
|
|||
<documentation help="http://asf.atmel.com/docs/3.11.0/common.applications.user_application.xplained_pro2.samd20_xplained_pro/html/index.html" />
|
||||
<offline-documentation help="" />
|
||||
<dependencies>
|
||||
<content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.11.0" />
|
||||
<content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.18.1" />
|
||||
</dependencies>
|
||||
<project id="common.applications.user_application.xplained_pro2.samd20_xplained_pro" value="Add" config="" content-id="Atmel.ASF" />
|
||||
<board id="board.samd20_xplained_pro" value="Add" config="" content-id="Atmel.ASF" />
|
||||
|
@ -216,6 +216,8 @@
|
|||
<ToolNumber>000591000435</ToolNumber>
|
||||
<ToolName>J-Link</ToolName>
|
||||
</com_atmel_avrdbg_tool_samice>
|
||||
<preserveEEPROM>true</preserveEEPROM>
|
||||
<ExternalProgrammingToolCommand />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
<ToolchainSettings>
|
||||
|
@ -282,38 +284,6 @@
|
|||
</armgcc.linker.libraries.LibrarySearchPaths>
|
||||
<armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
|
||||
<armgcc.linker.miscellaneous.LinkerFlags>-Wl,--entry=Reset_Handler -Wl,--cref -mthumb -T../src/ASF/sam0/utils/linker_scripts/samd20/gcc/samd20j18_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
|
||||
<armgcc.assembler.general.IncludePaths>
|
||||
<ListValues>
|
||||
<Value>../src</Value>
|
||||
<Value>../src/ASF/common/boards</Value>
|
||||
<Value>../src/ASF/common/utils</Value>
|
||||
<Value>../src/ASF/sam0/boards</Value>
|
||||
<Value>../src/ASF/sam0/boards/samd20_xplained_pro</Value>
|
||||
<Value>../src/ASF/sam0/drivers/port</Value>
|
||||
<Value>../src/ASF/sam0/drivers/system</Value>
|
||||
<Value>../src/ASF/sam0/drivers/system/clock</Value>
|
||||
<Value>../src/ASF/sam0/drivers/system/interrupt</Value>
|
||||
<Value>../src/ASF/sam0/drivers/system/pinmux</Value>
|
||||
<Value>../src/ASF/sam0/utils</Value>
|
||||
<Value>../src/ASF/sam0/utils/cmsis/samd20/include</Value>
|
||||
<Value>../src/ASF/sam0/utils/cmsis/samd20/include/component</Value>
|
||||
<Value>../src/ASF/sam0/utils/cmsis/samd20/include/instance</Value>
|
||||
<Value>../src/ASF/sam0/utils/cmsis/samd20/include/pio</Value>
|
||||
<Value>../src/ASF/sam0/utils/cmsis/samd20/source</Value>
|
||||
<Value>../src/ASF/sam0/utils/header_files</Value>
|
||||
<Value>../src/ASF/sam0/utils/preprocessor</Value>
|
||||
<Value>../src/ASF/thirdparty/CMSIS/Include</Value>
|
||||
<Value>../src/ASF/thirdparty/CMSIS/Lib/GCC</Value>
|
||||
<Value>../src/config</Value>
|
||||
<Value>%24(ToolchainDir)\..\..\CMSIS_Atmel</Value>
|
||||
<Value>%24(ToolchainDir)\..\..\CMSIS_Atmel\CMSIS\Include</Value>
|
||||
<Value>%24(ToolchainDir)\..\..\CMSIS_Atmel\Device\ATMEL</Value>
|
||||
<Value>%24(ToolchainDir)\..\..\CMSIS_Atmel\Device\ATMEL\samd20\include</Value>
|
||||
<Value>../src/ASF/common/services/serial</Value>
|
||||
<Value>../src/ASF/sam0/drivers/sercom</Value>
|
||||
<Value>../src/ASF/sam0/drivers/sercom/usart</Value>
|
||||
</ListValues>
|
||||
</armgcc.assembler.general.IncludePaths>
|
||||
<armgcc.preprocessingassembler.general.AssemblerFlags>-DARM_MATH_CM0=true -DBOARD=SAMD20_XPLAINED_PRO -D__SAMD20J18__ -DUSART_CALLBACK_MODE=true</armgcc.preprocessingassembler.general.AssemblerFlags>
|
||||
<armgcc.preprocessingassembler.general.IncludePaths>
|
||||
<ListValues>
|
||||
|
@ -419,38 +389,6 @@
|
|||
</armgcc.linker.libraries.LibrarySearchPaths>
|
||||
<armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
|
||||
<armgcc.linker.miscellaneous.LinkerFlags>-Wl,--entry=Reset_Handler -Wl,--cref -mthumb -T../src/ASF/sam0/utils/linker_scripts/samd20/gcc/samd20j18_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
|
||||
<armgcc.assembler.general.IncludePaths>
|
||||
<ListValues>
|
||||
<Value>../src</Value>
|
||||
<Value>../src/ASF/common/boards</Value>
|
||||
<Value>../src/ASF/common/utils</Value>
|
||||
<Value>../src/ASF/sam0/boards</Value>
|
||||
<Value>../src/ASF/sam0/boards/samd20_xplained_pro</Value>
|
||||
<Value>../src/ASF/sam0/drivers/port</Value>
|
||||
<Value>../src/ASF/sam0/drivers/system</Value>
|
||||
<Value>../src/ASF/sam0/drivers/system/clock</Value>
|
||||
<Value>../src/ASF/sam0/drivers/system/interrupt</Value>
|
||||
<Value>../src/ASF/sam0/drivers/system/pinmux</Value>
|
||||
<Value>../src/ASF/sam0/utils</Value>
|
||||
<Value>../src/ASF/sam0/utils/cmsis/samd20/include</Value>
|
||||
<Value>../src/ASF/sam0/utils/cmsis/samd20/include/component</Value>
|
||||
<Value>../src/ASF/sam0/utils/cmsis/samd20/include/instance</Value>
|
||||
<Value>../src/ASF/sam0/utils/cmsis/samd20/include/pio</Value>
|
||||
<Value>../src/ASF/sam0/utils/cmsis/samd20/source</Value>
|
||||
<Value>../src/ASF/sam0/utils/header_files</Value>
|
||||
<Value>../src/ASF/sam0/utils/preprocessor</Value>
|
||||
<Value>../src/ASF/thirdparty/CMSIS/Include</Value>
|
||||
<Value>../src/ASF/thirdparty/CMSIS/Lib/GCC</Value>
|
||||
<Value>../src/config</Value>
|
||||
<Value>%24(ToolchainDir)\..\..\CMSIS_Atmel</Value>
|
||||
<Value>%24(ToolchainDir)\..\..\CMSIS_Atmel\CMSIS\Include</Value>
|
||||
<Value>%24(ToolchainDir)\..\..\CMSIS_Atmel\Device\ATMEL</Value>
|
||||
<Value>%24(ToolchainDir)\..\..\CMSIS_Atmel\Device\ATMEL\samd20\include</Value>
|
||||
<Value>../src/ASF/common/services/serial</Value>
|
||||
<Value>../src/ASF/sam0/drivers/sercom</Value>
|
||||
<Value>../src/ASF/sam0/drivers/sercom/usart</Value>
|
||||
</ListValues>
|
||||
</armgcc.assembler.general.IncludePaths>
|
||||
<armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
|
||||
<armgcc.preprocessingassembler.general.AssemblerFlags>-DARM_MATH_CM0=true -DBOARD=SAMD20_XPLAINED_PRO -D__SAMD20J18__ -DUSART_CALLBACK_MODE=true</armgcc.preprocessingassembler.general.AssemblerFlags>
|
||||
<armgcc.preprocessingassembler.general.IncludePaths>
|
||||
|
|
|
@ -137,7 +137,7 @@ int main (void)
|
|||
|
||||
/* The mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting is described at the top
|
||||
of this file. */
|
||||
#if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1
|
||||
#if( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 )
|
||||
{
|
||||
main_blinky();
|
||||
}
|
||||
|
|
|
@ -1,17 +1,30 @@
|
|||
----------------------------------------------------------------------------
|
||||
|
||||
NOTE: The modification to the GPL documented below is included to allow you to
|
||||
distribute a combined work that includes FreeRTOS without being obliged to
|
||||
provide the source code for proprietary components.
|
||||
The FreeRTOS open source license covers the FreeRTOS source files,
|
||||
which are located in the /FreeRTOS/Source directory of the official FreeRTOS
|
||||
download. It also covers most of the source files in the demo application
|
||||
projects, which are located in the /FreeRTOS/Demo directory of the official
|
||||
FreeRTOS download. The demo projects may also include third party software that
|
||||
is not part of FreeRTOS and is licensed separately to FreeRTOS. Examples of
|
||||
third party software includes header files provided by chip or tools vendors,
|
||||
linker scripts, peripheral drivers, etc. All the software in subdirectories of
|
||||
the /FreeRTOS directory is either open source or distributed with permission,
|
||||
and is free for use. For the avoidance of doubt, refer to the comments at the
|
||||
top of each source file.
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
The FreeRTOS GPL Exception Text:
|
||||
NOTE: The modification to the GPL is included to allow you to distribute a
|
||||
combined work that includes FreeRTOS without being obliged to provide the source
|
||||
code for proprietary components.
|
||||
|
||||
Any FreeRTOS source code, whether modified or in it's original release form,
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
Applying to FreeRTOS V8.2.3 up to the latest version, the FreeRTOS GPL Exception
|
||||
Text follows:
|
||||
|
||||
Any FreeRTOS *source code*, whether modified or in it's original release form,
|
||||
or whether in whole or in part, can only be distributed by you under the terms
|
||||
of version 2 of the GNU General Public License plus this exception. An
|
||||
independent module is a module which is not derived from or based on FreeRTOS.
|
||||
of the GNU General Public License plus this exception. An independent module is
|
||||
a module which is not derived from or based on FreeRTOS.
|
||||
|
||||
Clause 1:
|
||||
|
||||
|
@ -35,9 +48,12 @@ express permission of Real Time Engineers Ltd. (this is the norm within the
|
|||
industry and is intended to ensure information accuracy).
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------
|
||||
|
||||
The standard GPL v2 text follows:
|
||||
|
||||
|
||||
The standard GPL V2 text:
|
||||
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
|
|
|
@ -91,7 +91,15 @@ task.h is included from an application file. */
|
|||
#define configADJUSTED_HEAP_SIZE ( configTOTAL_HEAP_SIZE - portBYTE_ALIGNMENT )
|
||||
|
||||
/* Allocate the memory for the heap. */
|
||||
static uint8_t ucHeap[ configTOTAL_HEAP_SIZE ];
|
||||
/* Allocate the memory for the heap. */
|
||||
#if( configAPPLICATION_ALLOCATED_HEAP == 1 )
|
||||
/* The application writer has already defined the array used for the RTOS
|
||||
heap - probably so it can be placed in a special segment or address. */
|
||||
extern uint8_t ucHeap[ configTOTAL_HEAP_SIZE ];
|
||||
#else
|
||||
static uint8_t ucHeap[ configTOTAL_HEAP_SIZE ];
|
||||
#endif /* configAPPLICATION_ALLOCATED_HEAP */
|
||||
|
||||
static size_t xNextFreeByte = ( size_t ) 0;
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
@ -102,12 +110,14 @@ void *pvReturn = NULL;
|
|||
static uint8_t *pucAlignedHeap = NULL;
|
||||
|
||||
/* Ensure that blocks are always aligned to the required number of bytes. */
|
||||
#if portBYTE_ALIGNMENT != 1
|
||||
#if( portBYTE_ALIGNMENT != 1 )
|
||||
{
|
||||
if( xWantedSize & portBYTE_ALIGNMENT_MASK )
|
||||
{
|
||||
/* Byte alignment required. */
|
||||
xWantedSize += ( portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK ) );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
vTaskSuspendAll();
|
||||
|
|
|
@ -97,7 +97,14 @@ task.h is included from an application file. */
|
|||
static void prvHeapInit( void );
|
||||
|
||||
/* Allocate the memory for the heap. */
|
||||
static uint8_t ucHeap[ configTOTAL_HEAP_SIZE ];
|
||||
#if( configAPPLICATION_ALLOCATED_HEAP == 1 )
|
||||
/* The application writer has already defined the array used for the RTOS
|
||||
heap - probably so it can be placed in a special segment or address. */
|
||||
extern uint8_t ucHeap[ configTOTAL_HEAP_SIZE ];
|
||||
#else
|
||||
static uint8_t ucHeap[ configTOTAL_HEAP_SIZE ];
|
||||
#endif /* configAPPLICATION_ALLOCATED_HEAP */
|
||||
|
||||
|
||||
/* Define the linked list structure. This is used to link free blocks in order
|
||||
of their size. */
|
||||
|
@ -127,7 +134,7 @@ static size_t xFreeBytesRemaining = configADJUSTED_HEAP_SIZE;
|
|||
*/
|
||||
#define prvInsertBlockIntoFreeList( pxBlockToInsert ) \
|
||||
{ \
|
||||
BlockLink_t *pxIterator; \
|
||||
BlockLink_t *pxIterator; \
|
||||
size_t xBlockSize; \
|
||||
\
|
||||
xBlockSize = pxBlockToInsert->xBlockSize; \
|
||||
|
|
Loading…
Reference in a new issue