aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/common/ARMCMx/nvic.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-02-05 19:55:42 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-02-05 19:55:42 +0000
commit23f759922d415d9adaab70424b2c67ff0d9b7181 (patch)
treec5379563c6621bdec6134c157ac47d030cf3666a /os/hal/ports/common/ARMCMx/nvic.c
parentd60e38b55f2d0ccdcdfb0086db6d16fd2de5c290 (diff)
downloadChibiOS-23f759922d415d9adaab70424b2c67ff0d9b7181.tar.gz
ChibiOS-23f759922d415d9adaab70424b2c67ff0d9b7181.tar.bz2
ChibiOS-23f759922d415d9adaab70424b2c67ff0d9b7181.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6667 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/ports/common/ARMCMx/nvic.c')
-rw-r--r--os/hal/ports/common/ARMCMx/nvic.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/os/hal/ports/common/ARMCMx/nvic.c b/os/hal/ports/common/ARMCMx/nvic.c
index 20bf60035..dbd165a9f 100644
--- a/os/hal/ports/common/ARMCMx/nvic.c
+++ b/os/hal/ports/common/ARMCMx/nvic.c
@@ -50,10 +50,9 @@
/**
* @brief Sets the priority of an interrupt handler and enables it.
- * @note The parameters are not tested for correctness.
*
* @param[in] n the interrupt number
- * @param[in] prio the interrupt priority mask
+ * @param[in] prio the interrupt priority
*/
void nvicEnableVector(uint32_t n, uint32_t prio) {
@@ -64,7 +63,6 @@ void nvicEnableVector(uint32_t n, uint32_t prio) {
/**
* @brief Disables an interrupt handler.
- * @note The parameters are not tested for correctness.
*
* @param[in] n the interrupt number
*/
@@ -74,4 +72,17 @@ void nvicDisableVector(uint32_t n) {
NVIC->IP[n] = 0;
}
+/**
+ * @brief Changes the priority of a system handler.
+ *
+ * @param[in] handler the system handler number
+ * @param[in] prio the system handler priority
+ */
+void nvicSetSystemHandlerPriority(uint32_t handler, uint32_t prio) {
+
+ osalDbgCheck((handler >= 4) && (handler <= 15));
+
+ SCB->SHP[handler - 4] = NVIC_PRIORITY_MASK(prio);
+}
+
/** @} */