From 2e13eab2c9c0b4819a6e7f4606aad09d971695d4 Mon Sep 17 00:00:00 2001 From: Mario Luzeiro Date: Wed, 23 Apr 2025 11:43:47 +0100 Subject: [PATCH 1/6] Add an assert to catch register overflow (#1265) --- portable/MPLAB/PIC32MZ/port.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/portable/MPLAB/PIC32MZ/port.c b/portable/MPLAB/PIC32MZ/port.c index 034fc26d14..4af1fb832c 100644 --- a/portable/MPLAB/PIC32MZ/port.c +++ b/portable/MPLAB/PIC32MZ/port.c @@ -234,6 +234,11 @@ __attribute__(( weak )) void vApplicationSetupTickTimerInterrupt( void ) { const uint32_t ulCompareMatch = ( (configPERIPHERAL_CLOCK_HZ / portTIMER_PRESCALE) / configTICK_RATE_HZ ) - 1UL; + /* PR1 is 16-bit. Ensure that the configPERIPHERAL_CLOCK_HZ and + * configTICK_RATE_HZ are defined such that ulCompareMatch value would fit + * in 16-bits. */ + configASSERT( ( ulCompareMatch & 0xFFFF0000 ) == 0 ); + T1CON = 0x0000; T1CONbits.TCKPS = portPRESCALE_BITS; PR1 = ulCompareMatch; From 78e617b0300a88f4844d0184b1f10fece02a870d Mon Sep 17 00:00:00 2001 From: Rahul Kar Date: Fri, 25 Apr 2025 06:23:47 +0000 Subject: [PATCH 2/6] Update ubuntu-20.04 to ubuntu-latest --- .github/workflows/ci.yml | 2 +- .github/workflows/formatting.yml | 2 +- .github/workflows/kernel-checks.yml | 2 +- .github/workflows/unit-tests.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index edda39154d..2765466bea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: jobs: formatting: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4.1.1 - name: Check Formatting of FreeRTOS-Kernel Files diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml index 2f369105aa..083a736e00 100644 --- a/.github/workflows/formatting.yml +++ b/.github/workflows/formatting.yml @@ -16,7 +16,7 @@ jobs: if: ${{ github.event.issue.pull_request && ( ( github.event.comment.body == '/bot run uncrustify' ) || ( github.event.comment.body == '/bot run formatting' ) ) }} - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Apply Formatting Fix id: check-formatting diff --git a/.github/workflows/kernel-checks.yml b/.github/workflows/kernel-checks.yml index ad3096f0d7..05443458c9 100644 --- a/.github/workflows/kernel-checks.yml +++ b/.github/workflows/kernel-checks.yml @@ -5,7 +5,7 @@ on: [push, pull_request] jobs: kernel-checker: name: FreeRTOS Kernel Header Checks - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: # Install python 3 - name: Tool Setup diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 3591436a4a..bc8aaf69c9 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -3,7 +3,7 @@ on: [push, pull_request] jobs: run: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Checkout Parent Repository uses: actions/checkout@v4.1.1 From ef514c4c85bd5943c45b0e7418ae4b60a17efcb5 Mon Sep 17 00:00:00 2001 From: Rahul Kar Date: Fri, 25 Apr 2025 09:59:07 +0000 Subject: [PATCH 3/6] Exclude template_configuration from uncrustiffy check --- .github/workflows/formatting.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml index 083a736e00..eabf9d0124 100644 --- a/.github/workflows/formatting.yml +++ b/.github/workflows/formatting.yml @@ -22,4 +22,6 @@ jobs: id: check-formatting uses: FreeRTOS/CI-CD-Github-Actions/formatting-bot@main with: - exclude-dirs: portable + exclude-dirs: | + portable + examples/template_configuration From f2fecf69c1c0afd50add15458b14f0fb5d65eb1b Mon Sep 17 00:00:00 2001 From: Rahul Kar Date: Fri, 25 Apr 2025 10:34:14 +0000 Subject: [PATCH 4/6] Fix build issue in formatting --- .github/workflows/formatting.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml index eabf9d0124..057e0728fe 100644 --- a/.github/workflows/formatting.yml +++ b/.github/workflows/formatting.yml @@ -22,6 +22,5 @@ jobs: id: check-formatting uses: FreeRTOS/CI-CD-Github-Actions/formatting-bot@main with: - exclude-dirs: | - portable - examples/template_configuration + exclude-dirs: portable, examples/template_configuration + From 5e7aa6e3d42f3bbe2f0b84405ef55ec31faf5371 Mon Sep 17 00:00:00 2001 From: Gaurav Aggarwal Date: Fri, 25 Apr 2025 11:14:24 +0000 Subject: [PATCH 5/6] Fix formatting check Signed-off-by: Gaurav Aggarwal --- examples/template_configuration/FreeRTOSConfig.h | 3 +++ include/croutine.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/examples/template_configuration/FreeRTOSConfig.h b/examples/template_configuration/FreeRTOSConfig.h index 5684e3c39e..5521adb4d3 100644 --- a/examples/template_configuration/FreeRTOSConfig.h +++ b/examples/template_configuration/FreeRTOSConfig.h @@ -415,6 +415,8 @@ * number of the failing assert (for example, "vAssertCalled( __FILE__, __LINE__ * )" or it can simple disable interrupts and sit in a loop to halt all * execution on the failing line for viewing in a debugger. */ + +/* *INDENT-OFF* */ #define configASSERT( x ) \ if( ( x ) == 0 ) \ { \ @@ -422,6 +424,7 @@ for( ; ; ) \ ; \ } +/* *INDENT-ON* */ /******************************************************************************/ /* FreeRTOS MPU specific definitions. *****************************************/ diff --git a/include/croutine.h b/include/croutine.h index 25f4caec86..a5e2e4462d 100644 --- a/include/croutine.h +++ b/include/croutine.h @@ -246,7 +246,10 @@ void vCoRoutineSchedule( void ); * \defgroup crSTART crSTART * \ingroup Tasks */ + +/* *INDENT-OFF* */ #define crEND() } +/* *INDENT-ON* */ /* * These macros are intended for internal use by the co-routine implementation From 0bda85b2472e4c2b99d5b9ce8744783f0a1cd3cc Mon Sep 17 00:00:00 2001 From: Rahul Kar Date: Fri, 25 Apr 2025 11:18:01 +0000 Subject: [PATCH 6/6] Add back template_configuration to uncrustify check --- .github/workflows/formatting.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml index 057e0728fe..811c3cb094 100644 --- a/.github/workflows/formatting.yml +++ b/.github/workflows/formatting.yml @@ -22,5 +22,5 @@ jobs: id: check-formatting uses: FreeRTOS/CI-CD-Github-Actions/formatting-bot@main with: - exclude-dirs: portable, examples/template_configuration + exclude-dirs: portable