Skip to content
Snippets Groups Projects
Commit 9666b3eb authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Used the _SIM macro to avoid some simulation build warnings.

parent 400aefe9
No related branches found
No related tags found
No related merge requests found
......@@ -1912,7 +1912,11 @@ __STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGr
*/
__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)
{
#ifdef _SIM
uint32_t *vectors = (uint32_t *)&SCB->VTOR;
#else
uint32_t *vectors = (uint32_t *)SCB->VTOR;
#endif
vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector;
}
......@@ -1927,7 +1931,11 @@ __STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)
*/
__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn)
{
#ifdef _SIM
uint32_t *vectors = (uint32_t *)&SCB->VTOR;
#else
uint32_t *vectors = (uint32_t *)SCB->VTOR;
#endif
return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET];
}
......
......@@ -1910,10 +1910,10 @@ __STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGr
*/
__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)
{
#ifndef _SIM
uint32_t *vectors = (uint32_t *)SCB->VTOR;
#else
#ifdef _SIM
uint32_t *vectors = (uint32_t *)&SCB->VTOR;
#else
uint32_t *vectors = (uint32_t *)SCB->VTOR;
#endif
vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector;
/* ARM Application Note 321 states that the M4 does not require the architectural barrier */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment