Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(Other): Use FreeRTOS Heap Allocation Scheme 4, Allow Changing FreeRTOS Heap Allocation Scheme #1052

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Examples/MAX78000/FreeRTOSDemo/project.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ DEBUG=1

LIB_FREERTOS = 1

# Can provide a value for the FREERTOS heap allocation scheme
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of documenting this here, you can add some info to the UG.

See here for an example for the SDHC library.

The FreeRTOS lib hasn't had any options before, so I'd suggest adding a similar table

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea! I'll update once this has been added.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be good now 👍

# Default value is 4
# FREERTOS_HEAP_TYPE := 2
# export FREERTOS_HEAP_TYPE

ifeq ($(BOARD),Aud01_RevA)
$(error ERR_NOTSUPPORTED: This project is not supported for the Audio board)
endif
19 changes: 18 additions & 1 deletion Libraries/FreeRTOS/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,29 @@ SRCS = list.c
SRCS += queue.c
SRCS += tasks.c
SRCS += port.c
SRCS += heap_2.c
SRCS += timers.c
SRCS += croutine.c
SRCS += event_groups.c
SRCS += stream_buffer.c

# Setup a default heap allocation mechanism
# Default val is 4, which is recommended to best avoid heap fragmentation
FREERTOS_HEAP_TYPE ?= 4

ifeq ($(FREERTOS_HEAP_TYPE), 1)
SRCS += heap_1.c
else ifeq ($(FREERTOS_HEAP_TYPE), 2)
SRCS += heap_2.c
else ifeq ($(FREERTOS_HEAP_TYPE), 3)
SRCS += heap_3.c
else ifeq ($(FREERTOS_HEAP_TYPE), 4)
SRCS += heap_4.c
else ifeq ($(FREERTOS_HEAP_TYPE), 5)
SRCS += heap_5.c
else
$(error FREERTOS_HEAP_TYPE must be between 1-5. Default: 4)
endif

# Where to find source files for this project
VPATH = Source/portable/GCC/ARM_CM4F
VPATH += Source/portable/MemMang
Expand Down
Loading