mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-05 05:43:51 -04:00
Replace the static prvSetupTimerInterrupt() function in the Cortex-M port layers that still used it (other than MPU ports so far) with a weakly defined function call vPortSetupTimerInterrupt() - which allows application writers to override the function with one that uses a different clock.
This commit is contained in:
parent
e23d638afd
commit
e292c67933
6 changed files with 68 additions and 49 deletions
|
@ -51,11 +51,11 @@
|
|||
#define portNVIC_SYSTICK_CLK_BIT ( 0 )
|
||||
#endif
|
||||
|
||||
/* The __weak attribute does not work as you might expect with the Keil tools
|
||||
so the configOVERRIDE_DEFAULT_TICK_CONFIGURATION constant must be set to 1 if
|
||||
the application writer wants to provide their own implementation of
|
||||
vPortSetupTimerInterrupt(). Ensure configOVERRIDE_DEFAULT_TICK_CONFIGURATION
|
||||
is defined. */
|
||||
/* Legacy macro for backward compatibility only. This macro used to be used to
|
||||
replace the function that configures the clock used to generate the tick
|
||||
interrupt (prvSetupTimerInterrupt()), but now the function is declared weak so
|
||||
the application writer can override it by simply defining a function of the
|
||||
same name (vApplicationSetupTickInterrupt()). */
|
||||
#ifndef configOVERRIDE_DEFAULT_TICK_CONFIGURATION
|
||||
#define configOVERRIDE_DEFAULT_TICK_CONFIGURATION 0
|
||||
#endif
|
||||
|
@ -523,13 +523,13 @@ void xPortSysTickHandler( void )
|
|||
__disable_irq();
|
||||
__dsb( portSY_FULL_READ_WRITE );
|
||||
__isb( portSY_FULL_READ_WRITE );
|
||||
|
||||
/* Disable the SysTick clock without reading the
|
||||
|
||||
/* Disable the SysTick clock without reading the
|
||||
portNVIC_SYSTICK_CTRL_REG register to ensure the
|
||||
portNVIC_SYSTICK_COUNT_FLAG_BIT is not cleared if it is set. Again,
|
||||
the time the SysTick is stopped for is accounted for as best it can
|
||||
be, but using the tickless mode will inevitably result in some tiny
|
||||
drift of the time maintained by the kernel with respect to calendar
|
||||
portNVIC_SYSTICK_COUNT_FLAG_BIT is not cleared if it is set. Again,
|
||||
the time the SysTick is stopped for is accounted for as best it can
|
||||
be, but using the tickless mode will inevitably result in some tiny
|
||||
drift of the time maintained by the kernel with respect to calendar
|
||||
time*/
|
||||
portNVIC_SYSTICK_CTRL_REG = ( portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT );
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue