Skip to content

Commit

Permalink
Clang Format FreeRTOS-Kernel and shared portable files
Browse files Browse the repository at this point in the history
  • Loading branch information
Skptak committed Sep 8, 2023
1 parent 2f94b18 commit 11519b2
Show file tree
Hide file tree
Showing 43 changed files with 18,497 additions and 15,134 deletions.
104 changes: 104 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: None
AlignConsecutiveBitFields: AcrossEmptyLinesAndComments
AlignConsecutiveDeclarations: None
AlignConsecutiveMacros: AcrossEmptyLinesAndComments
AlignEscapedNewlines: Left
AlignOperands: Align
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
BitFieldColonSpacing: Both
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: Always
AfterEnum: true
AfterExternBlock: false
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeConceptDeclarations: true
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
BreakStringLiterals: true
ColumnLimit: 90
CompactNamespaces: false
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DeriveLineEnding: false
DerivePointerAlignment: false
EmptyLineBeforeAccessModifier: Always
FixNamespaceComments: true
IncludeBlocks: Preserve
IndentCaseBlocks: false
IndentCaseLabels: true
IndentExternBlock: NoIndent
IndentGotoLabels: true
IndentPPDirectives: BeforeHash
IndentWidth: 4
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
PenaltyBreakAssignment: 1000
PenaltyBreakBeforeFirstCallParameter: 200
PenaltyBreakComment: 50
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 100
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 100
PenaltyIndentedWhitespace: 0
PenaltyReturnTypeOnItsOwnLine: 10000
PointerAlignment: Middle
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: false
SpaceBeforeInheritanceColon: false
SpaceBeforeParens: Never
SpaceBeforeRangeBasedForLoopColon: false
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInConditionalStatement: true
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: true
SpacesInParentheses: true
SpacesInSquareBrackets: true
TabWidth: 4
UseCRLF: false
UseTab: Never
...

16 changes: 14 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,23 @@ on:
workflow_dispatch:
jobs:
formatting:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Check Formatting of FreeRTOS-Kernel Files
uses: FreeRTOS/CI-CD-Github-Actions/formatting@main
uses: FreeRTOS/CI-CD-Github-Actions/clang-formatting@main
with:
exclude-dirs: portable

- name: Check Formatting of FreeRTOS-Kernel Heap Files
uses: FreeRTOS/CI-CD-Github-Actions/clang-formatting@main
with:
path: portable/MemMang

- name: Check Formatting of FreeRTOS-Kernel MPU Wrapper Files
uses: FreeRTOS/CI-CD-Github-Actions/clang-formatting@main
with:
path: portable/Common

spell-check:
runs-on: ubuntu-latest
Expand Down
763 changes: 489 additions & 274 deletions CMakeLists.txt

Large diffs are not rendered by default.

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

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

+ Introduce configRUN_TIME_COUNTER_TYPE which enables developers to define
+ Introduce configRUN_TIME_COUNTER_TYPE which enables developers to define
the type used to hold run time statistic counters. Defaults to uint32_t
for backward compatibility. #define configRUN_TIME_COUNTER_TYPE to a type
(for example, uint64_t) in FreeRTOSConfig.h to override the default.
Expand Down Expand Up @@ -639,55 +639,69 @@ Changes between FreeRTOS V9.0.1 and FreeRTOS V10.0.0:
+ Cortex-M ports push additional register prior to calling
vTaskSwitchContext to ensure 8-byte alignment is maintained. Only
important if a user defined tick hook function performs an operation that
requires 8-byte alignment.
+ Optimisations to the implementation of the standard tickless idle mode on
Cortex-M devices.
+ Improvements to the Win32 port including using higher priority threads.
+ Ensure interrupt stack alignment on PIC32 ports.
+ Updated GCC TriCore port to build with later compiler versions.
+ Update mpu_wrappers.c to support static allocation.
+ The uxNumberOfItems member of List_t is now volatile - solving an issue
when the IAR compiler was used with maximum optimization.
+ Introduced configRECORD_STACK_HIGH_ADDRESS. When set to 1 the stack start
address is saved into each task's TCB (assuming stack grows down).
+ Introduced configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H to allow user defined
functionality, and user defined initialisation, to be added to FreeRTOS's
tasks.c source file. When configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H is
set to 1 a user provided header file called freertos_task_c_additions.h
will be included at the bottom of tasks.c. Functions defined in that
header file can call freertos_tasks_c_additions_init(), which in turn
calls a macro called FREERTOS_TASKS_C_ADDITIONS_INIT(), if it is defined.
FREERTOS_TASKS_C_ADDITIONS_INIT() can be defined in FreeRTOSConfig.h.
+ Introduced configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING( x ) which can be
defined by a user in FreeRTOSConfig.h. The macro is called before
assessing whether to enter tickless idle mode or not. If the macro sets
x to zero then tickless idle mode will not be entered. This allows users
to abort tickless idle mode entry before the tickless idle function is
even called - previously it was only possible to abort from within the
tickless idle function itself.
+ Added configPRINTF(), which can be defined by users to allow all libraries
to use the same print formatter.
+ Introduced configMAX() and configMIN() macros which default to standard
max( x, y ) and min( x, y ) macro behaviour, but can be overridden if the
application writer defines the same macros in FreeRTOSConfig.h.
+ Corrected the definition of StaticTask_t in the case where
INCLUDE_xTaskAbortDelay is set to 1.
+ Introduced configTIMER_SERVICE_TASK_NAME and configIDLE_TASK_NAME, both of
which can be defined to strings in FreeRTOSConfig.h to change the default
names of the timer service and idle tasks respectively.
+ Only fill the stack of a newly created task with a known value if stack
checking, or high water mark checking/viewing, is in use - removing the
dependency on memset() in other cases.
+ Introduced xTaskCreateRestrictedStatic() so static allocation can be used
with the MPU.
+ Ensure suspended tasks cannot be unsuspended by a received task
notification.
+ Fix race condition in vTaskSetTimeOutState().
+ Updated trace recorder files to the latest version.

Changes since FreeRTOS V9.0.0:

+ Priority dis-inheritance behaviour has been enhanced in the case where a
requires 8-
byte alignment.+
Optimisations to the implementation of the standard tickless idle mode
on Cortex -
M devices.+
Improvements to the Win32 port including using higher priority threads.+
Ensure interrupt stack alignment on PIC32 ports.+
Updated GCC TriCore port to build with later compiler versions.+
Update mpu_wrappers.c to support static allocation.+
The uxNumberOfItems member of List_t is now volatile -
solving an issue when the IAR compiler was used with maximum
optimization.+
Introduced configRECORD_STACK_HIGH_ADDRESS.When set to 1 the stack start
address is saved into each
task's TCB (assuming stack grows down). + Introduced configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H to allow
user defined functionality,
and user defined initialisation,
to be added to FreeRTOS's tasks.c source file
.When configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H is set to 1 a user
provided header file called freertos_task_c_additions
.h will be included at the bottom of tasks.c.Functions defined in
that header file can call
freertos_tasks_c_additions_init(),
which in turn calls a macro called FREERTOS_TASKS_C_ADDITIONS_INIT(),
if it is defined
.FREERTOS_TASKS_C_ADDITIONS_INIT() can be defined in
FreeRTOSConfig.h.+
Introduced configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING( x )
which can be defined by a user in FreeRTOSConfig.h.The macro is called
before assessing whether to enter tickless idle mode or
not .If the macro sets x to zero then tickless idle mode
will not be entered.This allows users to abort tickless idle
mode entry before the tickless idle function is even called -
previously it was only possible to abort from within the tickless
idle function itself.+
Added configPRINTF(),
which can be defined by users to allow all libraries to use the same
print formatter.+
Introduced configMAX() and
configMIN() macros which default to standard max( x, y ) and
min( x, y ) macro behaviour,
but can be overridden if the
application writer defines the same macros in FreeRTOSConfig.h.+
Corrected the definition of StaticTask_t in the
case where INCLUDE_xTaskAbortDelay is set to 1. +
Introduced configTIMER_SERVICE_TASK_NAME and configIDLE_TASK_NAME,
both of which can be defined to strings in FreeRTOSConfig
.h to change the
default names of the timer service and idle tasks respectively.+
Only fill the stack of a newly created task with a known value
if stack checking,
or high water mark checking / viewing,
is in use - removing the dependency on memset() in other cases.+
Introduced xTaskCreateRestrictedStatic() so
static allocation can be used with the MPU.+
Ensure suspended tasks cannot be unsuspended by a received task
notification.+
Fix race condition in vTaskSetTimeOutState().+
Updated trace recorder files to the latest version.

Changes since FreeRTOS V9 .0.0:

+ Priority dis-inheritance behaviour has been enhanced in the case where a
task that attempted to take a mutex that was held by a lower priority task
timed out before it was able to obtain the mutex (causing the task that
holds the mutex to have its priority raised, then lowered again, in
Expand Down Expand Up @@ -724,7 +738,7 @@ Changes since FreeRTOS V9.0.0:

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

See https://www.FreeRTOS.org/FreeRTOS-V9.html
See https://www.FreeRTOS.org/FreeRTOS-V9.html

RTOS kernel updates:

Expand Down
38 changes: 23 additions & 15 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
MIT License

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

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in
all copies
or
substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS",
WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Loading

0 comments on commit 11519b2

Please sign in to comment.