Skip to content

Commit

Permalink
Address review comments from @ChristosZosi
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbartell committed Dec 1, 2022
1 parent 9e4eb73 commit 4ac44e2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions portable/GCC/ARM_CR5/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@
#error configMAX_API_CALL_INTERRUPT_PRIORITY must be greater than ( configUNIQUE_INTERRUPT_PRIORITIES / 2 )
#endif

/*
* __ARM_FP is defined by the c preprocessor when FPU support is enabled,
* ususally with the -mfpu= argument and mfloat-abi=.
*
* Note: Some implementations of the c standard library may use FPU registers
* for generic memory operations (memcpy, etc).
* When setting configUSE_TASK_FPU_SUPPORT == 1, care must be taken to
* ensure that the FPU registers are not used without an FPU context.
*/
#if configUSE_TASK_FPU_SUPPORT == 0
#ifdef __ARM_FP
#error __ARM_FP is defined, so configUSE_TASK_FPU_SUPPORT must be set to either to 1 or 2.
Expand Down
3 changes: 2 additions & 1 deletion portable/GCC/ARM_CR5/portmacro.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,16 @@ void FreeRTOS_Tick_Handler( void );
*/
#if ( configUSE_TASK_FPU_SUPPORT == 1 )
void vPortTaskUsesFPU( void );
#define portTASK_USES_FLOATING_POINT() vPortTaskUsesFPU()
#elif ( configUSE_TASK_FPU_SUPPORT == 2 )

/*
* Each task has an FPU context already, so define this function away to
* prevent it being called accidentally.
*/
#define vPortTaskUsesFPU()
#define portTASK_USES_FLOATING_POINT()
#endif /* configUSE_TASK_FPU_SUPPORT */
#define portTASK_USES_FLOATING_POINT() vPortTaskUsesFPU()

#define portLOWEST_INTERRUPT_PRIORITY ( ( ( uint32_t ) configUNIQUE_INTERRUPT_PRIORITIES ) - 1UL )
#define portLOWEST_USABLE_INTERRUPT_PRIORITY ( portLOWEST_INTERRUPT_PRIORITY - 1UL )
Expand Down

0 comments on commit 4ac44e2

Please sign in to comment.