Skip to content

Commit e4e34de

Browse files
committed
Clang Format FreeRTOS-Kernel and shared portable files
1 parent 2f94b18 commit e4e34de

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+16375
-13673
lines changed

.clang-format

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
---
2+
Language: Cpp
3+
AlignAfterOpenBracket: Align
4+
AlignConsecutiveAssignments: None
5+
AlignConsecutiveBitFields: AcrossEmptyLinesAndComments
6+
AlignConsecutiveDeclarations: None
7+
AlignConsecutiveMacros: AcrossEmptyLinesAndComments
8+
AlignEscapedNewlines: Left
9+
AlignOperands: Align
10+
AlignTrailingComments: true
11+
AllowAllArgumentsOnNextLine: false
12+
AllowAllParametersOfDeclarationOnNextLine: false
13+
AllowShortBlocksOnASingleLine: Never
14+
AllowShortCaseLabelsOnASingleLine: false
15+
AllowShortEnumsOnASingleLine: false
16+
AllowShortFunctionsOnASingleLine: None
17+
AllowShortIfStatementsOnASingleLine: false
18+
AllowShortLambdasOnASingleLine: All
19+
AllowShortLoopsOnASingleLine: false
20+
AlwaysBreakAfterReturnType: None
21+
AlwaysBreakBeforeMultilineStrings: false
22+
AlwaysBreakTemplateDeclarations: Yes
23+
BinPackArguments: false
24+
BinPackParameters: false
25+
BitFieldColonSpacing: Both
26+
BraceWrapping:
27+
AfterCaseLabel: true
28+
AfterClass: true
29+
AfterControlStatement: Always
30+
AfterEnum: true
31+
AfterExternBlock: false
32+
AfterFunction: true
33+
AfterNamespace: true
34+
AfterStruct: true
35+
AfterUnion: true
36+
BeforeCatch: true
37+
BeforeElse: true
38+
BeforeLambdaBody: false
39+
BeforeWhile: false
40+
IndentBraces: false
41+
SplitEmptyFunction: true
42+
SplitEmptyRecord: true
43+
SplitEmptyNamespace: true
44+
BreakBeforeBinaryOperators: None
45+
BreakBeforeBraces: Custom
46+
BreakBeforeConceptDeclarations: true
47+
BreakBeforeTernaryOperators: true
48+
BreakConstructorInitializers: BeforeColon
49+
BreakInheritanceList: BeforeColon
50+
BreakStringLiterals: true
51+
ColumnLimit: 90
52+
CompactNamespaces: false
53+
ContinuationIndentWidth: 4
54+
Cpp11BracedListStyle: false
55+
DeriveLineEnding: false
56+
DerivePointerAlignment: false
57+
EmptyLineBeforeAccessModifier: Always
58+
FixNamespaceComments: true
59+
IncludeBlocks: Preserve
60+
IndentCaseBlocks: false
61+
IndentCaseLabels: true
62+
IndentExternBlock: NoIndent
63+
IndentGotoLabels: true
64+
IndentPPDirectives: BeforeHash
65+
IndentWidth: 4
66+
KeepEmptyLinesAtTheStartOfBlocks: false
67+
MaxEmptyLinesToKeep: 1
68+
NamespaceIndentation: None
69+
PenaltyBreakAssignment: 1000
70+
PenaltyBreakBeforeFirstCallParameter: 200
71+
PenaltyBreakComment: 50
72+
PenaltyBreakFirstLessLess: 120
73+
PenaltyBreakString: 100
74+
PenaltyBreakTemplateDeclaration: 10
75+
PenaltyExcessCharacter: 100
76+
PenaltyIndentedWhitespace: 0
77+
PenaltyReturnTypeOnItsOwnLine: 10000
78+
PointerAlignment: Middle
79+
ReflowComments: true
80+
SortIncludes: false
81+
SortUsingDeclarations: true
82+
SpaceAfterCStyleCast: true
83+
SpaceAfterLogicalNot: false
84+
SpaceAfterTemplateKeyword: false
85+
SpaceBeforeCpp11BracedList: true
86+
SpaceBeforeCtorInitializerColon: false
87+
SpaceBeforeInheritanceColon: false
88+
SpaceBeforeParens: Never
89+
SpaceBeforeRangeBasedForLoopColon: false
90+
SpaceBeforeSquareBrackets: false
91+
SpaceInEmptyBlock: false
92+
SpaceInEmptyParentheses: false
93+
SpacesBeforeTrailingComments: 1
94+
SpacesInAngles: false
95+
SpacesInConditionalStatement: true
96+
SpacesInContainerLiterals: true
97+
SpacesInCStyleCastParentheses: true
98+
SpacesInParentheses: true
99+
SpacesInSquareBrackets: true
100+
TabWidth: 4
101+
UseCRLF: false
102+
UseTab: Never
103+
...
104+

.github/scripts/kernel_checker.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
'FreeRTOS-openocd.c',
3838
'Makefile',
3939
'.DS_Store',
40-
'cspell.config.yaml'
40+
'cspell.config.yaml',
41+
'.clang-format',
4142
]
4243

4344
KERNEL_IGNORED_EXTENSIONS = [

.github/workflows/ci.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,24 @@ on:
77
workflow_dispatch:
88
jobs:
99
formatting:
10-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-22.04
1111
steps:
1212
- uses: actions/checkout@v3
1313
- name: Check Formatting of FreeRTOS-Kernel Files
14-
uses: FreeRTOS/CI-CD-Github-Actions/formatting@main
14+
uses: FreeRTOS/CI-CD-Github-Actions/clang-formatting@main
15+
with:
16+
exclude-dirs: portable
17+
exclude-files: CMakeLists.txt
18+
19+
- name: Check Formatting of FreeRTOS-Kernel Heap Files
20+
uses: FreeRTOS/CI-CD-Github-Actions/clang-formatting@main
21+
with:
22+
path: portable/MemMang
23+
24+
- name: Check Formatting of FreeRTOS-Kernel MPU Wrapper Files
25+
uses: FreeRTOS/CI-CD-Github-Actions/clang-formatting@main
26+
with:
27+
path: portable/Common
1528

1629
spell-check:
1730
runs-on: ubuntu-latest

History.txt

Lines changed: 82 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -64,23 +64,23 @@ Changes between FreeRTOS V10.5.1 and FreeRTOS 10.6.0 released July 13, 2023
6464
- Yueqi Chen, Zicheng Wang, Minghao Lin, Jiahe Wang of University of
6565
Colorado Boulder, USA.
6666
+ Add Cortex-M35P port. Contributed by @urutva.
67-
+ Add embedded extension (RV32E) support to the IAR RISC-V port.
68-
+ Add ulTaskGetRunTimeCounter and ulTaskGetRunTimePercent APIs. Contributed by
69-
@chrisnc.
70-
+ Add APIs to get the application supplied buffers from statically
71-
created kernel objects. The following new APIs are added:
72-
- xTaskGetStaticBuffers
73-
- xQueueGetStaticBuffers
74-
- xQueueGenericGetStaticBuffers
75-
- xSemaphoreGetStaticBuffer
76-
- xEventGroupGetStaticBuffer
77-
- xStreamBufferGetStaticBuffers
78-
- xMessageBufferGetStaticBuffers
79-
These APIs enable the application writer to obtain static buffers from
80-
the kernel object and free/reuse them at the time of deletion. Earlier
81-
the application writer had to maintain the association of static buffers
82-
and the kernel object in the application. Contributed by @Dazza0.
83-
+ Add Thread Local Storage (TLS) support using picolibc function. Contributed
67+
+ Add embedded extension (RV32E)
68+
support to the IAR RISC - V port.+
69+
Add ulTaskGetRunTimeCounter and ulTaskGetRunTimePercent
70+
APIs.Contributed by @chrisnc.+
71+
Add APIs to get the application supplied buffers from statically created
72+
kernel objects.The following new APIs are added
73+
: -xTaskGetStaticBuffers -
74+
xQueueGetStaticBuffers - xQueueGenericGetStaticBuffers -
75+
xSemaphoreGetStaticBuffer - xEventGroupGetStaticBuffer -
76+
xStreamBufferGetStaticBuffers -
77+
xMessageBufferGetStaticBuffers These APIs enable the application writer to
78+
obtain static buffers from the kernel object and free /
79+
reuse them at the time of deletion
80+
.Earlier the application writer had to maintain the association
81+
of static buffers and the kernel object in the
82+
application.Contributed by @Dazza0.+
83+
Add Thread Local Storage( TLS ) support using picolibc function. Contributed
8484
by @keith-packard.
8585
+ Add configTICK_TYPE_WIDTH_IN_BITS to configure TickType_t data type. As a result,
8686
the number of bits in an event group also increases with big data type. Contributed
@@ -273,7 +273,7 @@ Changes between FreeRTOS V10.4.4 and FreeRTOS V10.4.5 released September 10 2021
273273

274274
See https://www.FreeRTOS.org/FreeRTOS-V10.4.5.html
275275

276-
+ Introduce configRUN_TIME_COUNTER_TYPE which enables developers to define
276+
+ Introduce configRUN_TIME_COUNTER_TYPE which enables developers to define
277277
the type used to hold run time statistic counters. Defaults to uint32_t
278278
for backward compatibility. #define configRUN_TIME_COUNTER_TYPE to a type
279279
(for example, uint64_t) in FreeRTOSConfig.h to override the default.
@@ -639,55 +639,69 @@ Changes between FreeRTOS V9.0.1 and FreeRTOS V10.0.0:
639639
+ Cortex-M ports push additional register prior to calling
640640
vTaskSwitchContext to ensure 8-byte alignment is maintained. Only
641641
important if a user defined tick hook function performs an operation that
642-
requires 8-byte alignment.
643-
+ Optimisations to the implementation of the standard tickless idle mode on
644-
Cortex-M devices.
645-
+ Improvements to the Win32 port including using higher priority threads.
646-
+ Ensure interrupt stack alignment on PIC32 ports.
647-
+ Updated GCC TriCore port to build with later compiler versions.
648-
+ Update mpu_wrappers.c to support static allocation.
649-
+ The uxNumberOfItems member of List_t is now volatile - solving an issue
650-
when the IAR compiler was used with maximum optimization.
651-
+ Introduced configRECORD_STACK_HIGH_ADDRESS. When set to 1 the stack start
652-
address is saved into each task's TCB (assuming stack grows down).
653-
+ Introduced configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H to allow user defined
654-
functionality, and user defined initialisation, to be added to FreeRTOS's
655-
tasks.c source file. When configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H is
656-
set to 1 a user provided header file called freertos_task_c_additions.h
657-
will be included at the bottom of tasks.c. Functions defined in that
658-
header file can call freertos_tasks_c_additions_init(), which in turn
659-
calls a macro called FREERTOS_TASKS_C_ADDITIONS_INIT(), if it is defined.
660-
FREERTOS_TASKS_C_ADDITIONS_INIT() can be defined in FreeRTOSConfig.h.
661-
+ Introduced configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING( x ) which can be
662-
defined by a user in FreeRTOSConfig.h. The macro is called before
663-
assessing whether to enter tickless idle mode or not. If the macro sets
664-
x to zero then tickless idle mode will not be entered. This allows users
665-
to abort tickless idle mode entry before the tickless idle function is
666-
even called - previously it was only possible to abort from within the
667-
tickless idle function itself.
668-
+ Added configPRINTF(), which can be defined by users to allow all libraries
669-
to use the same print formatter.
670-
+ Introduced configMAX() and configMIN() macros which default to standard
671-
max( x, y ) and min( x, y ) macro behaviour, but can be overridden if the
672-
application writer defines the same macros in FreeRTOSConfig.h.
673-
+ Corrected the definition of StaticTask_t in the case where
674-
INCLUDE_xTaskAbortDelay is set to 1.
675-
+ Introduced configTIMER_SERVICE_TASK_NAME and configIDLE_TASK_NAME, both of
676-
which can be defined to strings in FreeRTOSConfig.h to change the default
677-
names of the timer service and idle tasks respectively.
678-
+ Only fill the stack of a newly created task with a known value if stack
679-
checking, or high water mark checking/viewing, is in use - removing the
680-
dependency on memset() in other cases.
681-
+ Introduced xTaskCreateRestrictedStatic() so static allocation can be used
682-
with the MPU.
683-
+ Ensure suspended tasks cannot be unsuspended by a received task
684-
notification.
685-
+ Fix race condition in vTaskSetTimeOutState().
686-
+ Updated trace recorder files to the latest version.
687-
688-
Changes since FreeRTOS V9.0.0:
689-
690-
+ Priority dis-inheritance behaviour has been enhanced in the case where a
642+
requires 8-
643+
byte alignment.+
644+
Optimisations to the implementation of the standard tickless idle mode
645+
on Cortex -
646+
M devices.+
647+
Improvements to the Win32 port including using higher priority threads.+
648+
Ensure interrupt stack alignment on PIC32 ports.+
649+
Updated GCC TriCore port to build with later compiler versions.+
650+
Update mpu_wrappers.c to support static allocation.+
651+
The uxNumberOfItems member of List_t is now volatile -
652+
solving an issue when the IAR compiler was used with maximum
653+
optimization.+
654+
Introduced configRECORD_STACK_HIGH_ADDRESS.When set to 1 the stack start
655+
address is saved into each
656+
task's TCB (assuming stack grows down). + Introduced configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H to allow
657+
user defined functionality,
658+
and user defined initialisation,
659+
to be added to FreeRTOS's tasks.c source file
660+
.When configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H is set to 1 a user
661+
provided header file called freertos_task_c_additions
662+
.h will be included at the bottom of tasks.c.Functions defined in
663+
that header file can call
664+
freertos_tasks_c_additions_init(),
665+
which in turn calls a macro called FREERTOS_TASKS_C_ADDITIONS_INIT(),
666+
if it is defined
667+
.FREERTOS_TASKS_C_ADDITIONS_INIT() can be defined in
668+
FreeRTOSConfig.h.+
669+
Introduced configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING( x )
670+
which can be defined by a user in FreeRTOSConfig.h.The macro is called
671+
before assessing whether to enter tickless idle mode or
672+
not .If the macro sets x to zero then tickless idle mode
673+
will not be entered.This allows users to abort tickless idle
674+
mode entry before the tickless idle function is even called -
675+
previously it was only possible to abort from within the tickless
676+
idle function itself.+
677+
Added configPRINTF(),
678+
which can be defined by users to allow all libraries to use the same
679+
print formatter.+
680+
Introduced configMAX() and
681+
configMIN() macros which default to standard max( x, y ) and
682+
min( x, y ) macro behaviour,
683+
but can be overridden if the
684+
application writer defines the same macros in FreeRTOSConfig.h.+
685+
Corrected the definition of StaticTask_t in the
686+
case where INCLUDE_xTaskAbortDelay is set to 1. +
687+
Introduced configTIMER_SERVICE_TASK_NAME and configIDLE_TASK_NAME,
688+
both of which can be defined to strings in FreeRTOSConfig
689+
.h to change the
690+
default names of the timer service and idle tasks respectively.+
691+
Only fill the stack of a newly created task with a known value
692+
if stack checking,
693+
or high water mark checking / viewing,
694+
is in use - removing the dependency on memset() in other cases.+
695+
Introduced xTaskCreateRestrictedStatic() so
696+
static allocation can be used with the MPU.+
697+
Ensure suspended tasks cannot be unsuspended by a received task
698+
notification.+
699+
Fix race condition in vTaskSetTimeOutState().+
700+
Updated trace recorder files to the latest version.
701+
702+
Changes since FreeRTOS V9 .0.0:
703+
704+
+ Priority dis-inheritance behaviour has been enhanced in the case where a
691705
task that attempted to take a mutex that was held by a lower priority task
692706
timed out before it was able to obtain the mutex (causing the task that
693707
holds the mutex to have its priority raised, then lowered again, in
@@ -724,7 +738,7 @@ Changes since FreeRTOS V9.0.0:
724738

725739
Changes between FreeRTOS V9.0.0 and FreeRTOS V9.0.0rc2 released May 25 2016:
726740

727-
See https://www.FreeRTOS.org/FreeRTOS-V9.html
741+
See https://www.FreeRTOS.org/FreeRTOS-V9.html
728742

729743
RTOS kernel updates:
730744

LICENSE.md

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
11
MIT License
22

3-
Permission is hereby granted, free of charge, to any person obtaining a copy
4-
of this software and associated documentation files (the "Software"), to deal
5-
in the Software without restriction, including without limitation the rights
6-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7-
copies of the Software, and to permit persons to whom the Software is
8-
furnished to do so, subject to the following conditions:
3+
Permission is hereby granted,
4+
free of charge,
5+
to any person obtaining a copy of this software and associated documentation
6+
files( the "Software" ),
7+
to deal in the Software without restriction,
8+
including without limitation the rights to use, copy, modify, merge, publish
9+
,
10+
distribute, sublicense, and / or sell copies of the Software,
11+
and to permit persons to whom the Software is furnished to do so,
12+
subject to the following conditions:
913

10-
The above copyright notice and this permission notice shall be included in all
11-
copies or substantial portions of the Software.
14+
The above copyright notice and this permission notice shall be included in
15+
all copies
16+
or
17+
substantial portions of the Software.
1218

13-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19-
SOFTWARE.
19+
THE SOFTWARE IS PROVIDED "AS IS",
20+
WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21+
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
23+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
24+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25+
TORT OR OTHERWISE, ARISING FROM,
26+
OUT OF OR IN
27+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)