mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-05-17 23:46:36 +08:00
Add an assert to catch register overflow (#1265)
This commit is contained in:
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -7,7 +7,7 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
jobs:
|
jobs:
|
||||||
formatting:
|
formatting:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.1.1
|
- uses: actions/checkout@v4.1.1
|
||||||
- name: Check Formatting of FreeRTOS-Kernel Files
|
- name: Check Formatting of FreeRTOS-Kernel Files
|
||||||
|
3
.github/workflows/formatting.yml
vendored
3
.github/workflows/formatting.yml
vendored
@ -16,10 +16,11 @@ jobs:
|
|||||||
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 uncrustify' ) ||
|
||||||
( github.event.comment.body == '/bot run formatting' ) ) }}
|
( github.event.comment.body == '/bot run formatting' ) ) }}
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Apply Formatting Fix
|
- name: Apply Formatting Fix
|
||||||
id: check-formatting
|
id: check-formatting
|
||||||
uses: FreeRTOS/CI-CD-Github-Actions/formatting-bot@main
|
uses: FreeRTOS/CI-CD-Github-Actions/formatting-bot@main
|
||||||
with:
|
with:
|
||||||
exclude-dirs: portable
|
exclude-dirs: portable
|
||||||
|
|
||||||
|
2
.github/workflows/kernel-checks.yml
vendored
2
.github/workflows/kernel-checks.yml
vendored
@ -5,7 +5,7 @@ on: [push, pull_request]
|
|||||||
jobs:
|
jobs:
|
||||||
kernel-checker:
|
kernel-checker:
|
||||||
name: FreeRTOS Kernel Header Checks
|
name: FreeRTOS Kernel Header Checks
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
# Install python 3
|
# Install python 3
|
||||||
- name: Tool Setup
|
- name: Tool Setup
|
||||||
|
2
.github/workflows/unit-tests.yml
vendored
2
.github/workflows/unit-tests.yml
vendored
@ -3,7 +3,7 @@ on: [push, pull_request]
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run:
|
run:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Parent Repository
|
- name: Checkout Parent Repository
|
||||||
uses: actions/checkout@v4.1.1
|
uses: actions/checkout@v4.1.1
|
||||||
|
@ -415,6 +415,8 @@
|
|||||||
* number of the failing assert (for example, "vAssertCalled( __FILE__, __LINE__
|
* number of the failing assert (for example, "vAssertCalled( __FILE__, __LINE__
|
||||||
* )" or it can simple disable interrupts and sit in a loop to halt all
|
* )" or it can simple disable interrupts and sit in a loop to halt all
|
||||||
* execution on the failing line for viewing in a debugger. */
|
* execution on the failing line for viewing in a debugger. */
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
#define configASSERT( x ) \
|
#define configASSERT( x ) \
|
||||||
if( ( x ) == 0 ) \
|
if( ( x ) == 0 ) \
|
||||||
{ \
|
{ \
|
||||||
@ -422,6 +424,7 @@
|
|||||||
for( ; ; ) \
|
for( ; ; ) \
|
||||||
; \
|
; \
|
||||||
}
|
}
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
/* FreeRTOS MPU specific definitions. *****************************************/
|
/* FreeRTOS MPU specific definitions. *****************************************/
|
||||||
|
@ -246,7 +246,10 @@ void vCoRoutineSchedule( void );
|
|||||||
* \defgroup crSTART crSTART
|
* \defgroup crSTART crSTART
|
||||||
* \ingroup Tasks
|
* \ingroup Tasks
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
#define crEND() }
|
#define crEND() }
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These macros are intended for internal use by the co-routine implementation
|
* These macros are intended for internal use by the co-routine implementation
|
||||||
|
@ -234,6 +234,11 @@ __attribute__(( weak )) void vApplicationSetupTickTimerInterrupt( void )
|
|||||||
{
|
{
|
||||||
const uint32_t ulCompareMatch = ( (configPERIPHERAL_CLOCK_HZ / portTIMER_PRESCALE) / configTICK_RATE_HZ ) - 1UL;
|
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;
|
T1CON = 0x0000;
|
||||||
T1CONbits.TCKPS = portPRESCALE_BITS;
|
T1CONbits.TCKPS = portPRESCALE_BITS;
|
||||||
PR1 = ulCompareMatch;
|
PR1 = ulCompareMatch;
|
||||||
|
Reference in New Issue
Block a user