Skip to content

Commit

Permalink
Merge branch 'main' into spareFreeRTOSCheckout
Browse files Browse the repository at this point in the history
  • Loading branch information
Skptak authored Oct 5, 2023
2 parents 6b7f4ee + 30e13da commit cc008b2
Show file tree
Hide file tree
Showing 74 changed files with 1,999 additions and 475 deletions.
4 changes: 3 additions & 1 deletion .github/scripts/kernel_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@
r'.*portable/ThirdParty/xClang/XCOREAI/*',
r'.*IAR/ARM_C*',
r'.*IAR/78K0R/*',
r'.*CCS/MSP430X/*'
r'.*CCS/MSP430X/*',
r'.*portable/template/*',
r'.*sample_configuration/*'
]

KERNEL_THIRD_PARTY_PATTERNS = [
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ env:
jobs:
Formatting:
name: Run Formatting Check
if: ${{ github.event.issue.pull_request }} &&
if: ${{ github.event.issue.pull_request &&
( ( github.event.comment.body == '/bot run uncrustify' ) ||
( github.event.comment.body == '/bot run formatting' ) )
( github.event.comment.body == '/bot run formatting' ) ) }}
runs-on: ubuntu-20.04
steps:
- name: Apply Formatting Fix
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ if(NOT FREERTOS_PORT)
" SOFTUNE_MB91460 - Compiler: Softune Target: MB91460\n"
" SOFTUNE_MB96340 - Compiler: Softune Target: MB96340\n"
" TASKING_ARM_CM4F - Compiler: Tasking Target: ARM Cortex-M4 with FPU\n"
" TEMPLATE - Compiler: HOST Target: None\n"
" CDK_THEAD_CK802 - Compiler: CDK Target: T-head CK802\n"
" XCC_XTENSA - Compiler: XCC Target: Xtensa\n"
" WIZC_PIC18 - Compiler: WizC Target: PIC18")
Expand Down
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[![CMock Unit Tests](https://github.com/FreeRTOS/FreeRTOS-Kernel/actions/workflows/unit-tests.yml/badge.svg?branch=main&event=push)](https://github.com/FreeRTOS/FreeRTOS-Kernel/actions/workflows/unit-tests.yml?query=branch%3Amain+event%3Apush+workflow%3A%22CMock+Unit+Tests%22++)
[![codecov](https://codecov.io/gh/FreeRTOS/FreeRTOS-Kernel/badge.svg?branch=main)](https://codecov.io/gh/FreeRTOS/FreeRTOS-Kernel)

## Getting started

This repository contains FreeRTOS kernel source/header files and kernel
ports only. This repository is referenced as a submodule in
[FreeRTOS/FreeRTOS](https://github.com/FreeRTOS/FreeRTOS)
Expand All @@ -20,13 +22,15 @@ Additionally, for FreeRTOS kernel feature information refer to the
and [API Reference](https://www.FreeRTOS.org/a00106.html).

### Getting help

If you have any questions or need assistance troubleshooting your FreeRTOS project,
we have an active community that can help on the
[FreeRTOS Community Support Forum](https://forums.freertos.org).

## To consume FreeRTOS-Kernel

### Consume with CMake

If using CMake, it is recommended to use this repository using FetchContent.
Add the following into your project's main or a subdirectory's `CMakeLists.txt`:

Expand All @@ -42,12 +46,13 @@ FetchContent_Declare( freertos_kernel
In case you prefer to add it as a git submodule, do:

```bash
$ git submodule add https://github.com/FreeRTOS/FreeRTOS-Kernel.git <path of the submodule>
$ git submodule update --init
git submodule add https://github.com/FreeRTOS/FreeRTOS-Kernel.git <path of the submodule>
git submodule update --init
```

- Add a freertos_config library (typically an INTERFACE library) The following assumes the directory structure:
- `include/FreeRTOSConfig.h`

```cmake
add_library(freertos_config INTERFACE)
Expand Down Expand Up @@ -93,15 +98,19 @@ target_compile_options(freertos_config INTERFACE ${options})
### Consuming stand-alone - Cloning this repository

To clone using HTTPS:

```
git clone https://github.com/FreeRTOS/FreeRTOS-Kernel.git
```

Using SSH:

```
git clone git@github.com:FreeRTOS/FreeRTOS-Kernel.git
```

## Repository structure

- The root of this repository contains the three files that are common to
every port - list.c, queue.c and tasks.c. The kernel is contained within these
three files. croutine.c implements the optional co-routine functionality - which
Expand All @@ -112,7 +121,11 @@ See the readme file in the ```./portable``` directory for more information.

- The ```./include``` directory contains the real time kernel header files.

- The ```./sample_configuration``` directory contains a sample `FreeRTOSConfig.h` to help jumpstart a new project.
See the [FreeRTOSConfig.h](sample_configuration/FreeRTOSConfig.h) file for instructions.

### Code Formatting

FreeRTOS files are formatted using the
"[uncrustify](https://github.com/uncrustify/uncrustify)" tool.
The configuration file used by uncrustify can be found in the
Expand All @@ -121,26 +134,31 @@ The configuration file used by uncrustify can be found in the
file.

### Line Endings

File checked into the FreeRTOS-Kernel repository use unix-style LF line endings
for the best compatibility with git.

For optimal compatibility with Microsoft Windows tools, it is best to enable
the git autocrlf feature. You can enable this setting for the current
repository using the following command:

```
git config core.autocrlf true
```

### Git History Optimizations

Some commits in this repository perform large refactors which touch many lines
and lead to unwanted behavior when using the `git blame` command. You can
configure git to ignore the list of large refactor commits in this repository
with the following command:

```
git config blame.ignoreRevsFile .git-blame-ignore-revs
```

### Spelling and Formatting

We recommend using [Visual Studio Code](https://code.visualstudio.com),
commonly referred to as VSCode, when working on the FreeRTOS-Kernel.
The FreeRTOS-Kernel also uses [cSpell](https://cspell.org/) as part of its
Expand Down
20 changes: 2 additions & 18 deletions event_groups.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,15 +253,7 @@ EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup,
{
if( xAlreadyYielded == pdFALSE )
{
#if ( configNUMBER_OF_CORES == 1 )
{
portYIELD_WITHIN_API();
}
#else /* #if ( configNUMBER_OF_CORES == 1 ) */
{
vTaskYieldWithinAPI();
}
#endif /* #if ( configNUMBER_OF_CORES == 1 ) */
taskYIELD_WITHIN_API();
}
else
{
Expand Down Expand Up @@ -417,15 +409,7 @@ EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
{
if( xAlreadyYielded == pdFALSE )
{
#if ( configNUMBER_OF_CORES == 1 )
{
portYIELD_WITHIN_API();
}
#else /* #if ( configNUMBER_OF_CORES == 1 ) */
{
vTaskYieldWithinAPI();
}
#endif /* #if ( configNUMBER_OF_CORES == 1 ) */
taskYIELD_WITHIN_API();
}
else
{
Expand Down
28 changes: 12 additions & 16 deletions include/FreeRTOS.h
Original file line number Diff line number Diff line change
Expand Up @@ -453,14 +453,6 @@

#endif /* portGET_ISR_LOCK */

#ifndef portCHECK_IF_IN_ISR

#if ( configNUMBER_OF_CORES > 1 )
#error portCHECK_IF_IN_ISR is required in SMP
#endif

#endif /* portCHECK_IF_IN_ISR */

#ifndef portENTER_CRITICAL_FROM_ISR

#if ( configNUMBER_OF_CORES > 1 )
Expand Down Expand Up @@ -2154,20 +2146,20 @@
#define traceRETURN_vTaskExitCriticalFromISR()
#endif

#ifndef traceENTER_vTaskList
#define traceENTER_vTaskList( pcWriteBuffer )
#ifndef traceENTER_vTaskListTasks
#define traceENTER_vTaskListTasks( pcWriteBuffer, uxBufferLength )
#endif

#ifndef traceRETURN_vTaskList
#define traceRETURN_vTaskList()
#ifndef traceRETURN_vTaskListTasks
#define traceRETURN_vTaskListTasks()
#endif

#ifndef traceENTER_vTaskGetRunTimeStats
#define traceENTER_vTaskGetRunTimeStats( pcWriteBuffer )
#ifndef traceENTER_vTaskGetRunTimeStatistics
#define traceENTER_vTaskGetRunTimeStatistics( pcWriteBuffer, uxBufferLength )
#endif

#ifndef traceRETURN_vTaskGetRunTimeStats
#define traceRETURN_vTaskGetRunTimeStats()
#ifndef traceRETURN_vTaskGetRunTimeStatistics
#define traceRETURN_vTaskGetRunTimeStatistics()
#endif

#ifndef traceENTER_uxTaskResetEventItemValue
Expand Down Expand Up @@ -2686,6 +2678,10 @@
#endif
#endif

#ifndef configSTATS_BUFFER_MAX_LENGTH
#define configSTATS_BUFFER_MAX_LENGTH 0xFFFF
#endif

#ifndef configSTACK_DEPTH_TYPE

/* Defaults to uint16_t for backward compatibility, but can be overridden
Expand Down
Loading

0 comments on commit cc008b2

Please sign in to comment.