79 #error This port can only be used when the project options are configured to enable hardware floating point support. 82 #ifndef configSYSTICK_CLOCK_HZ 83 #define configSYSTICK_CLOCK_HZ configCPU_CLOCK_HZ 85 #define portNVIC_SYSTICK_CLK_BIT ( 1UL << 2UL ) 89 #define portNVIC_SYSTICK_CLK_BIT ( 0 ) 93 #define portNVIC_SYSTICK_CTRL_REG ( * ( ( volatile uint32_t * ) 0xe000e010 ) ) 94 #define portNVIC_SYSTICK_LOAD_REG ( * ( ( volatile uint32_t * ) 0xe000e014 ) ) 95 #define portNVIC_SYSTICK_CURRENT_VALUE_REG ( * ( ( volatile uint32_t * ) 0xe000e018 ) ) 96 #define portNVIC_SYSPRI2_REG ( * ( ( volatile uint32_t * ) 0xe000ed20 ) ) 98 #define portNVIC_SYSTICK_INT_BIT ( 1UL << 1UL ) 99 #define portNVIC_SYSTICK_ENABLE_BIT ( 1UL << 0UL ) 100 #define portNVIC_SYSTICK_COUNT_FLAG_BIT ( 1UL << 16UL ) 101 #define portNVIC_PENDSVCLEAR_BIT ( 1UL << 27UL ) 102 #define portNVIC_PEND_SYSTICK_CLEAR_BIT ( 1UL << 25UL ) 104 #define portNVIC_PENDSV_PRI ( ( ( uint32_t ) configKERNEL_INTERRUPT_PRIORITY ) << 16UL ) 105 #define portNVIC_SYSTICK_PRI ( ( ( uint32_t ) configKERNEL_INTERRUPT_PRIORITY ) << 24UL ) 108 #define portFIRST_USER_INTERRUPT_NUMBER ( 16 ) 109 #define portNVIC_IP_REGISTERS_OFFSET_16 ( 0xE000E3F0 ) 110 #define portAIRCR_REG ( * ( ( volatile uint32_t * ) 0xE000ED0C ) ) 111 #define portMAX_8_BIT_VALUE ( ( uint8_t ) 0xff ) 112 #define portTOP_BIT_OF_BYTE ( ( uint8_t ) 0x80 ) 113 #define portMAX_PRIGROUP_BITS ( ( uint8_t ) 7 ) 114 #define portPRIORITY_GROUP_MASK ( 0x07UL << 8UL ) 115 #define portPRIGROUP_SHIFT ( 8UL ) 118 #define portVECTACTIVE_MASK ( 0xFFUL ) 121 #define portFPCCR ( ( volatile uint32_t * ) 0xe000ef34 ) 122 #define portASPEN_AND_LSPEN_BITS ( 0x3UL << 30UL ) 125 #define portINITIAL_XPSR ( 0x01000000 ) 126 #define portINITIAL_EXEC_RETURN ( 0xfffffffd ) 129 #define portMAX_24_BIT_NUMBER ( 0xffffffUL ) 134 #define portMISSED_COUNTS_FACTOR ( 45UL ) 139 #ifdef configTASK_RETURN_ADDRESS 140 #define portTASK_RETURN_ADDRESS configTASK_RETURN_ADDRESS 142 #define portTASK_RETURN_ADDRESS prvTaskExitError 166 static
void prvPortStartFirstTask(
void )
__attribute__ (( naked ));
171 static
void vPortEnableVFP(
void )
__attribute__ (( naked ));
176 static
void prvTaskExitError(
void );
183 #if configUSE_TICKLESS_IDLE == 1 184 static uint32_t ulTimerCountsForOneTick = 0;
191 #if configUSE_TICKLESS_IDLE == 1 192 static uint32_t xMaximumPossibleSuppressedTicks = 0;
199 #if configUSE_TICKLESS_IDLE == 1 200 static uint32_t ulStoppedTimerCompensation = 0;
208 #if ( configASSERT_DEFINED == 1 ) 209 static uint8_t ucMaxSysCallPriority = 0;
210 static uint32_t ulMaxPRIGROUPValue = 0;
249 static void prvTaskExitError(
void )
266 " ldr r3, pxCurrentTCBConst2 \n" 269 " ldmia r0!, {r4-r11, r14} \n" 273 " msr basepri, r0 \n" 277 "pxCurrentTCBConst2: .word pxCurrentTCB \n" 282 static void prvPortStartFirstTask(
void )
285 " ldr r0, =0xE000ED08 \n" 308 #if( configASSERT_DEFINED == 1 ) 310 volatile uint32_t ulOriginalPriority;
312 volatile uint8_t ucMaxPriorityValue;
320 ulOriginalPriority = *pucFirstUserPriorityRegister;
327 ucMaxPriorityValue = *pucFirstUserPriorityRegister;
337 ulMaxPRIGROUPValue--;
338 ucMaxPriorityValue <<= ( uint8_t ) 0x01;
348 *pucFirstUserPriorityRegister = ulOriginalPriority;
361 uxCriticalNesting = 0;
370 prvPortStartFirstTask();
401 if( uxCriticalNesting == 1 )
412 if( uxCriticalNesting == 0 )
428 " ldr r3, pxCurrentTCBConst \n" 433 " vstmdbeq r0!, {s16-s31} \n" 435 " stmdb r0!, {r4-r11, r14} \n" 439 " stmdb sp!, {r3} \n" 442 " msr basepri, r0 \n" 446 " bl vTaskSwitchContext \n" 448 " msr basepri, r0 \n" 449 " ldmia sp!, {r3} \n" 454 " ldmia r0!, {r4-r11, r14} \n" 458 " vldmiaeq r0!, {s16-s31} \n" 463 #ifdef WORKAROUND_PMU_CM001 464 #if WORKAROUND_PMU_CM001 == 1 473 "pxCurrentTCBConst: .word pxCurrentTCB \n" 499 #if configUSE_TICKLESS_IDLE == 1 503 uint32_t ulReloadValue, ulCompleteTickPeriods, ulCompletedSysTickDecrements, ulSysTickCTRL;
507 if( xExpectedIdleTime > xMaximumPossibleSuppressedTicks )
509 xExpectedIdleTime = xMaximumPossibleSuppressedTicks;
522 if( ulReloadValue > ulStoppedTimerCompensation )
524 ulReloadValue -= ulStoppedTimerCompensation;
529 __asm
volatile(
"cpsid i" );
548 __asm
volatile(
"cpsie i" );
567 xModifiableIdleTime = xExpectedIdleTime;
569 if( xModifiableIdleTime > 0 )
571 __asm
volatile(
"dsb" );
572 __asm
volatile(
"wfi" );
573 __asm
volatile(
"isb" );
586 __asm
volatile(
"cpsie i" );
590 uint32_t ulCalculatedLoadValue;
601 if( ( ulCalculatedLoadValue < ulStoppedTimerCompensation ) || ( ulCalculatedLoadValue > ulTimerCountsForOneTick ) )
603 ulCalculatedLoadValue = ( ulTimerCountsForOneTick - 1UL );
613 ulCompleteTickPeriods = xExpectedIdleTime - 1UL;
625 ulCompleteTickPeriods = ulCompletedSysTickDecrements / ulTimerCountsForOneTick;
658 #if configUSE_TICKLESS_IDLE == 1 673 static void vPortEnableVFP(
void )
677 " ldr.w r0, =0xE000ED88 \n" 680 " orr r1, r1, #( 0xf << 20 ) \n" 687 #if( configASSERT_DEFINED == 1 ) 689 void vPortValidateInterruptPriority(
void )
691 uint32_t ulCurrentInterrupt;
692 uint8_t ucCurrentPriority;
695 __asm
volatile(
"mrs %0, ipsr" :
"=r"( ulCurrentInterrupt ) );
701 ucCurrentPriority = pcInterruptPriorityRegisters[ ulCurrentInterrupt ];
726 configASSERT( ucCurrentPriority >= ucMaxSysCallPriority );
#define portNVIC_SYSTICK_CLK_BIT
BaseType_t xPortStartScheduler(void)
void xPortPendSVHandler(void xPortSysTickHandler void)
#define portMISSED_COUNTS_FACTOR
void xPortSysTickHandler(void)
#define portENABLE_INTERRUPTS()
#define portDISABLE_INTERRUPTS()
#define portPRIGROUP_SHIFT
#define portCLEAR_INTERRUPT_MASK_FROM_ISR(uxSavedStatusValue)
#define portTOP_BIT_OF_BYTE
void vPortEnterCritical(void)
#define portNVIC_SYSPRI2_REG
void vPortSVCHandler(void)
unsigned long UBaseType_t
void vPortEndScheduler(void)
#define portNVIC_SYSTICK_PRI
void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime)
void vTaskStepTick(const TickType_t xTicksToJump) PRIVILEGED_FUNCTION
#define portSET_INTERRUPT_MASK_FROM_ISR()
#define configPOST_SLEEP_PROCESSING(x)
#define portPRIORITY_GROUP_MASK
StackType_t * pxPortInitialiseStack(StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters) PRIVILEGED_FUNCTION
#define configCPU_CLOCK_HZ
#define portNVIC_PENDSV_PRI
#define configMAX_SYSCALL_INTERRUPT_PRIORITY
#define portNVIC_SYSTICK_LOAD_REG
#define portNVIC_SYSTICK_CURRENT_VALUE_REG
#define configTICK_RATE_HZ
#define portMAX_PRIGROUP_BITS
#define portEXIT_CRITICAL()
#define portFIRST_USER_INTERRUPT_NUMBER
#define portVECTACTIVE_MASK
#define configPRE_SLEEP_PROCESSING(x)
#define configSYSTICK_CLOCK_HZ
#define portTASK_RETURN_ADDRESS
BaseType_t xTaskIncrementTick(void) PRIVILEGED_FUNCTION
#define portENTER_CRITICAL()
#define portNVIC_SYSTICK_INT_BIT
void vPortSetupTimerInterrupt(void)
eSleepModeStatus eTaskConfirmSleepModeStatus(void) PRIVILEGED_FUNCTION
#define portNVIC_SYSTICK_COUNT_FLAG_BIT
#define portINITIAL_EXEC_RETURN
#define portNVIC_SYSTICK_CTRL_REG
#define portNVIC_IP_REGISTERS_OFFSET_16
#define portMAX_8_BIT_VALUE
#define portNVIC_SYSTICK_ENABLE_BIT
#define portMAX_24_BIT_NUMBER
void(* TaskFunction_t)(void *)
#define portASPEN_AND_LSPEN_BITS
portSTACK_TYPE StackType_t
#define portNVIC_PENDSVSET_BIT
#define portNVIC_INT_CTRL_REG
void vPortExitCritical(void)