[external][ARM][CMSIS] reapply the systick patch to cmsis
SysTick_Config() tries to set the systick priority to max. Comment out this line since arch/arm/arm-m/arch.c sets the priority to medium to compete with the rest of the exceptions in the system. Also include lk/compiler.h to avoid redundant cmsis macros.
This commit is contained in:
@@ -25,6 +25,9 @@
|
|||||||
#ifndef __CMSIS_GCC_H
|
#ifndef __CMSIS_GCC_H
|
||||||
#define __CMSIS_GCC_H
|
#define __CMSIS_GCC_H
|
||||||
|
|
||||||
|
/* LK: include lk's compiler.h first, which has some of the same #defines */
|
||||||
|
#include <lk/compiler.h>
|
||||||
|
|
||||||
/* ignore some GCC warnings */
|
/* ignore some GCC warnings */
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wsign-conversion"
|
#pragma GCC diagnostic ignored "-Wsign-conversion"
|
||||||
|
|||||||
@@ -4084,7 +4084,7 @@ __STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
||||||
NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
// LK NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
||||||
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
||||||
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
||||||
SysTick_CTRL_TICKINT_Msk |
|
SysTick_CTRL_TICKINT_Msk |
|
||||||
|
|||||||
@@ -2168,7 +2168,7 @@ __STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
||||||
NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
// LK NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
||||||
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
||||||
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
||||||
SysTick_CTRL_TICKINT_Msk |
|
SysTick_CTRL_TICKINT_Msk |
|
||||||
|
|||||||
@@ -3065,7 +3065,7 @@ __STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
||||||
NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
// LK NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
||||||
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
||||||
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
||||||
SysTick_CTRL_TICKINT_Msk |
|
SysTick_CTRL_TICKINT_Msk |
|
||||||
|
|||||||
@@ -928,7 +928,7 @@ __STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
||||||
NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
// LK NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
||||||
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
||||||
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
||||||
SysTick_CTRL_TICKINT_Msk |
|
SysTick_CTRL_TICKINT_Msk |
|
||||||
|
|||||||
@@ -1063,7 +1063,7 @@ __STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
||||||
NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
// LK NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
||||||
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
||||||
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
||||||
SysTick_CTRL_TICKINT_Msk |
|
SysTick_CTRL_TICKINT_Msk |
|
||||||
|
|||||||
@@ -955,7 +955,7 @@ __STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
||||||
NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
// LK NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
||||||
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
||||||
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
||||||
SysTick_CTRL_TICKINT_Msk |
|
SysTick_CTRL_TICKINT_Msk |
|
||||||
|
|||||||
@@ -2243,7 +2243,7 @@ __STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
||||||
NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
// LK NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
||||||
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
||||||
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
||||||
SysTick_CTRL_TICKINT_Msk |
|
SysTick_CTRL_TICKINT_Msk |
|
||||||
|
|||||||
@@ -1841,7 +1841,7 @@ __STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
||||||
NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
// LK NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
||||||
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
||||||
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
||||||
SysTick_CTRL_TICKINT_Msk |
|
SysTick_CTRL_TICKINT_Msk |
|
||||||
|
|||||||
@@ -3133,7 +3133,7 @@ __STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
||||||
NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
// LK NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
||||||
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
||||||
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
||||||
SysTick_CTRL_TICKINT_Msk |
|
SysTick_CTRL_TICKINT_Msk |
|
||||||
|
|||||||
@@ -3133,7 +3133,7 @@ __STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
||||||
NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
// LK NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
||||||
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
||||||
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
||||||
SysTick_CTRL_TICKINT_Msk |
|
SysTick_CTRL_TICKINT_Msk |
|
||||||
|
|||||||
@@ -2027,7 +2027,7 @@ __STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
||||||
NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
// LK NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
||||||
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
||||||
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
||||||
SysTick_CTRL_TICKINT_Msk |
|
SysTick_CTRL_TICKINT_Msk |
|
||||||
|
|||||||
@@ -4145,7 +4145,7 @@ __STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
||||||
NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
// LK NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
||||||
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
||||||
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
||||||
SysTick_CTRL_TICKINT_Msk |
|
SysTick_CTRL_TICKINT_Msk |
|
||||||
|
|||||||
@@ -2264,7 +2264,7 @@ __STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
||||||
NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
// LK NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
||||||
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
||||||
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
||||||
SysTick_CTRL_TICKINT_Msk |
|
SysTick_CTRL_TICKINT_Msk |
|
||||||
|
|||||||
@@ -1006,7 +1006,7 @@ __STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
||||||
NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
// LK NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
||||||
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
||||||
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
||||||
SysTick_CTRL_TICKINT_Msk |
|
SysTick_CTRL_TICKINT_Msk |
|
||||||
|
|||||||
@@ -1815,7 +1815,7 @@ __STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
||||||
NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
// LK NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
||||||
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
||||||
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
||||||
SysTick_CTRL_TICKINT_Msk |
|
SysTick_CTRL_TICKINT_Msk |
|
||||||
|
|||||||
Reference in New Issue
Block a user