38 #error This port can only be used when the project options are configured to enable hardware floating point support.
42#define portNVIC_SYSTICK_CTRL_REG ( *( ( volatile uint32_t * ) 0xe000e010 ) )
43#define portNVIC_SYSTICK_LOAD_REG ( *( ( volatile uint32_t * ) 0xe000e014 ) )
44#define portNVIC_SYSTICK_CURRENT_VALUE_REG ( *( ( volatile uint32_t * ) 0xe000e018 ) )
45#define portNVIC_SHPR3_REG ( *( ( volatile uint32_t * ) 0xe000ed20 ) )
47#define portNVIC_SYSTICK_CLK_BIT ( 1UL << 2UL )
48#define portNVIC_SYSTICK_INT_BIT ( 1UL << 1UL )
49#define portNVIC_SYSTICK_ENABLE_BIT ( 1UL << 0UL )
50#define portNVIC_SYSTICK_COUNT_FLAG_BIT ( 1UL << 16UL )
51#define portNVIC_PENDSVCLEAR_BIT ( 1UL << 27UL )
52#define portNVIC_PEND_SYSTICK_SET_BIT ( 1UL << 26UL )
53#define portNVIC_PEND_SYSTICK_CLEAR_BIT ( 1UL << 25UL )
57#define portCPUID ( *( ( volatile uint32_t * ) 0xE000ed00 ) )
58#define portCORTEX_M7_r0p1_ID ( 0x410FC271UL )
59#define portCORTEX_M7_r0p0_ID ( 0x410FC270UL )
61#define portMIN_INTERRUPT_PRIORITY ( 255UL )
62#define portNVIC_PENDSV_PRI ( ( ( uint32_t ) portMIN_INTERRUPT_PRIORITY ) << 16UL )
63#define portNVIC_SYSTICK_PRI ( ( ( uint32_t ) portMIN_INTERRUPT_PRIORITY ) << 24UL )
66#define portFIRST_USER_INTERRUPT_NUMBER ( 16 )
67#define portNVIC_IP_REGISTERS_OFFSET_16 ( 0xE000E3F0 )
68#define portAIRCR_REG ( *( ( volatile uint32_t * ) 0xE000ED0C ) )
69#define portMAX_8_BIT_VALUE ( ( uint8_t ) 0xff )
70#define portTOP_BIT_OF_BYTE ( ( uint8_t ) 0x80 )
71#define portMAX_PRIGROUP_BITS ( ( uint8_t ) 7 )
72#define portPRIORITY_GROUP_MASK ( 0x07UL << 8UL )
73#define portPRIGROUP_SHIFT ( 8UL )
76#define portVECTACTIVE_MASK ( 0xFFUL )
79#define portFPCCR ( ( volatile uint32_t * ) 0xe000ef34 )
80#define portASPEN_AND_LSPEN_BITS ( 0x3UL << 30UL )
83#define portINITIAL_XPSR ( 0x01000000 )
84#define portINITIAL_EXC_RETURN ( 0xfffffffd )
87#define portMAX_24_BIT_NUMBER ( 0xffffffUL )
91#define portSTART_ADDRESS_MASK ( ( StackType_t ) 0xfffffffeUL )
96#define portMISSED_COUNTS_FACTOR ( 94UL )
101#ifndef configSYSTICK_CLOCK_HZ
102 #define configSYSTICK_CLOCK_HZ ( configCPU_CLOCK_HZ )
104 #define portNVIC_SYSTICK_CLK_BIT_CONFIG ( portNVIC_SYSTICK_CLK_BIT )
107 #define portNVIC_SYSTICK_CLK_BIT_CONFIG ( 0 )
113#ifdef configTASK_RETURN_ADDRESS
114 #define portTASK_RETURN_ADDRESS configTASK_RETURN_ADDRESS
116 #define portTASK_RETURN_ADDRESS prvTaskExitError
157#if ( configUSE_TICKLESS_IDLE == 1 )
158 static uint32_t ulTimerCountsForOneTick = 0;
165#if ( configUSE_TICKLESS_IDLE == 1 )
166 static uint32_t xMaximumPossibleSuppressedTicks = 0;
173#if ( configUSE_TICKLESS_IDLE == 1 )
174 static uint32_t ulStoppedTimerCompensation = 0;
182#if ( configASSERT_DEFINED == 1 )
183 static uint8_t ucMaxSysCallPriority = 0;
184 static uint32_t ulMaxPRIGROUPValue = 0;
195 void * pvParameters )
227 volatile uint32_t ulDummy = 0;
238 while( ulDummy == 0 )
254 " ldr r3, pxCurrentTCBConst2 \n"
257 " ldmia r0!, {r4-r11, r14} \n"
261 " msr basepri, r0 \n"
265 "pxCurrentTCBConst2: .word pxCurrentTCB \n"
277 " ldr r0, =0xE000ED08 \n"
282 " msr control, r0 \n"
305 #if ( configASSERT_DEFINED == 1 )
307 volatile uint8_t ucOriginalPriority;
308 volatile uint32_t ulImplementedPrioBits = 0;
310 volatile uint8_t ucMaxPriorityValue;
318 ucOriginalPriority = *pucFirstUserPriorityRegister;
325 ucMaxPriorityValue = *pucFirstUserPriorityRegister;
347 ulImplementedPrioBits++;
348 ucMaxPriorityValue <<= ( uint8_t ) 0x01;
351 if( ulImplementedPrioBits == 8 )
371 ulMaxPRIGROUPValue = 0;
385 *pucFirstUserPriorityRegister = ucOriginalPriority;
398 uxCriticalNesting = 0;
441 if( uxCriticalNesting == 1 )
453 if( uxCriticalNesting == 0 )
469 " ldr r3, pxCurrentTCBConst \n"
474 " vstmdbeq r0!, {s16-s31} \n"
476 " stmdb r0!, {r4-r11, r14} \n"
479 " stmdb sp!, {r0, r3} \n"
481 " msr basepri, r0 \n"
484 " bl vTaskSwitchContext \n"
486 " msr basepri, r0 \n"
487 " ldmia sp!, {r0, r3} \n"
492 " ldmia r0!, {r4-r11, r14} \n"
496 " vldmiaeq r0!, {s16-s31} \n"
501 #ifdef WORKAROUND_PMU_CM001
502 #if WORKAROUND_PMU_CM001 == 1
511 "pxCurrentTCBConst: .word pxCurrentTCB \n"
537#if ( configUSE_TICKLESS_IDLE == 1 )
541 uint32_t ulReloadValue, ulCompleteTickPeriods, ulCompletedSysTickDecrements, ulSysTickDecrementsLeft;
545 if( xExpectedIdleTime > xMaximumPossibleSuppressedTicks )
547 xExpectedIdleTime = xMaximumPossibleSuppressedTicks;
552 __asm
volatile (
"cpsid i" :::
"memory" );
553 __asm
volatile (
"dsb" );
554 __asm
volatile (
"isb" );
562 __asm
volatile (
"cpsie i" :::
"memory" );
579 if( ulSysTickDecrementsLeft == 0 )
581 ulSysTickDecrementsLeft = ulTimerCountsForOneTick;
590 ulReloadValue = ulSysTickDecrementsLeft + ( ulTimerCountsForOneTick * ( xExpectedIdleTime - 1UL ) );
595 ulReloadValue -= ulTimerCountsForOneTick;
598 if( ulReloadValue > ulStoppedTimerCompensation )
600 ulReloadValue -= ulStoppedTimerCompensation;
618 xModifiableIdleTime = xExpectedIdleTime;
621 if( xModifiableIdleTime > 0 )
623 __asm
volatile (
"dsb" :::
"memory" );
624 __asm
volatile (
"wfi" );
625 __asm
volatile (
"isb" );
633 __asm
volatile (
"cpsie i" :::
"memory" );
634 __asm
volatile (
"dsb" );
635 __asm
volatile (
"isb" );
641 __asm
volatile (
"cpsid i" :::
"memory" );
642 __asm
volatile (
"dsb" );
643 __asm
volatile (
"isb" );
657 uint32_t ulCalculatedLoadValue;
668 if( ( ulCalculatedLoadValue <= ulStoppedTimerCompensation ) || ( ulCalculatedLoadValue > ulTimerCountsForOneTick ) )
670 ulCalculatedLoadValue = ( ulTimerCountsForOneTick - 1UL );
678 ulCompleteTickPeriods = xExpectedIdleTime - 1UL;
688 #if ( portNVIC_SYSTICK_CLK_BIT_CONFIG != portNVIC_SYSTICK_CLK_BIT )
695 if( ulSysTickDecrementsLeft == 0 )
697 ulSysTickDecrementsLeft = ulReloadValue;
705 ulCompletedSysTickDecrements = ( xExpectedIdleTime * ulTimerCountsForOneTick ) - ulSysTickDecrementsLeft;
709 ulCompleteTickPeriods = ulCompletedSysTickDecrements / ulTimerCountsForOneTick;
713 portNVIC_SYSTICK_LOAD_REG = ( ( ulCompleteTickPeriods + 1UL ) * ulTimerCountsForOneTick ) - ulCompletedSysTickDecrements;
725 #if ( portNVIC_SYSTICK_CLK_BIT_CONFIG == portNVIC_SYSTICK_CLK_BIT )
751 __asm
volatile (
"cpsie i" :::
"memory" );
765 #if ( configUSE_TICKLESS_IDLE == 1 )
788 " ldr.w r0, =0xE000ED88 \n"
791 " orr r1, r1, #( 0xf << 20 ) \n"
799#if ( configASSERT_DEFINED == 1 )
801 void vPortValidateInterruptPriority(
void )
803 uint32_t ulCurrentInterrupt;
804 uint8_t ucCurrentPriority;
807 __asm
volatile (
"mrs %0, ipsr" :
"=r" ( ulCurrentInterrupt )::
"memory" );
813 ucCurrentPriority = pcInterruptPriorityRegisters[ ulCurrentInterrupt ];
838 configASSERT( ucCurrentPriority >= ucMaxSysCallPriority );
#define configTICK_RATE_HZ
#define configMAX_SYSCALL_INTERRUPT_PRIORITY
#define configCPU_CLOCK_HZ
#define configPOST_SLEEP_PROCESSING(x)
#define configPRE_SLEEP_PROCESSING(x)
#define portTOP_BIT_OF_BYTE
#define portMAX_24_BIT_NUMBER
#define portNVIC_SYSTICK_COUNT_FLAG_BIT
#define portTASK_RETURN_ADDRESS
void vPortEnterCritical(void)
#define portPRIGROUP_SHIFT
#define portINITIAL_EXC_RETURN
#define portPRIORITY_GROUP_MASK
#define portNVIC_PEND_SYSTICK_SET_BIT
void vPortSetupTimerInterrupt(void)
#define portNVIC_SYSTICK_ENABLE_BIT
void xPortPendSVHandler(void)
static void prvPortStartFirstTask(void)
#define portMISSED_COUNTS_FACTOR
#define portMAX_8_BIT_VALUE
#define portNVIC_SHPR3_REG
static void vPortEnableVFP(void)
#define portNVIC_SYSTICK_LOAD_REG
#define portNVIC_PENDSV_PRI
#define portNVIC_IP_REGISTERS_OFFSET_16
void xPortSysTickHandler(void)
static void prvTaskExitError(void)
#define portNVIC_SYSTICK_CURRENT_VALUE_REG
void vPortSVCHandler(void)
#define portCORTEX_M7_r0p1_ID
#define portNVIC_PEND_SYSTICK_CLEAR_BIT
#define portNVIC_SYSTICK_CLK_BIT
#define portVECTACTIVE_MASK
#define portFIRST_USER_INTERRUPT_NUMBER
#define configSYSTICK_CLOCK_HZ
#define portASPEN_AND_LSPEN_BITS
#define portMAX_PRIGROUP_BITS
#define portSTART_ADDRESS_MASK
#define portCORTEX_M7_r0p0_ID
#define portNVIC_SYSTICK_CTRL_REG
#define portNVIC_SYSTICK_CLK_BIT_CONFIG
BaseType_t xPortStartScheduler(void)
#define portNVIC_SYSTICK_PRI
#define portNVIC_SYSTICK_INT_BIT
void vPortExitCritical(void)
void vPortEndScheduler(void)
StackType_t * pxPortInitialiseStack(StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters) PRIVILEGED_FUNCTION
#define portNVIC_PENDSVSET_BIT
unsigned long UBaseType_t
#define portDISABLE_INTERRUPTS()
portSTACK_TYPE StackType_t
#define portENABLE_INTERRUPTS()
#define portNVIC_INT_CTRL_REG
void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime)
void(* TaskFunction_t)(void *)
void vTaskStepTick(TickType_t xTicksToJump) PRIVILEGED_FUNCTION
portDONT_DISCARD void vTaskSwitchContext(void) PRIVILEGED_FUNCTION
BaseType_t xTaskIncrementTick(void) PRIVILEGED_FUNCTION
eSleepModeStatus eTaskConfirmSleepModeStatus(void) PRIVILEGED_FUNCTION