cm3: extract SCB SHPR to the SCB world it belongs to

Pull out the duplicate into the right file, keeping the newly fixed
version.
This commit is contained in:
Karl Palsson
2019-10-18 22:33:23 +00:00
parent 3ebd71b464
commit 833da4b672
3 changed files with 12 additions and 20 deletions

View File

@@ -44,7 +44,7 @@
/**@{*/
#include <libopencm3/cm3/nvic.h>
#include <libopencm3/cm3/scs.h>
#include <libopencm3/cm3/scb.h>
/*---------------------------------------------------------------------------*/
/** @brief NVIC Enable Interrupt
@@ -161,10 +161,10 @@ void nvic_set_priority(uint8_t irqn, uint8_t priority)
irqn = (irqn & 0xF) - 4;
uint8_t shift = (irqn & 0x3) << 3;
uint8_t reg = irqn >> 2;
SCS_SHPR32(reg) = ((SCS_SHPR32(reg) & ~(0xFFUL << shift)) |
SCB_SHPR32(reg) = ((SCB_SHPR32(reg) & ~(0xFFUL << shift)) |
((uint32_t) priority) << shift);
#else
SCS_SHPR((irqn & 0xF) - 4) = priority;
SCB_SHPR((irqn & 0xF) - 4) = priority;
#endif
} else {
/* Device specific interrupts */