git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7841 35acf78f-673a-0410-8e92-d51de3d6d3f4

This commit is contained in:
Giovanni Di Sirio 2015-04-01 13:22:44 +00:00
parent bee88358cf
commit 9366ed77a6
2 changed files with 11 additions and 0 deletions

View File

@ -85,4 +85,14 @@ void nvicSetSystemHandlerPriority(uint32_t handler, uint32_t prio) {
SCB->SHP[handler] = NVIC_PRIORITY_MASK(prio); SCB->SHP[handler] = NVIC_PRIORITY_MASK(prio);
} }
/**
* @brief Clears a pending interrupt source.
*
* @param[in] n the interrupt number
*/
void nvicClearPending(uint32_t n) {
NVIC->ICPR[n >> 5] = 1 << (n & 0x1F);
}
/** @} */ /** @} */

View File

@ -78,6 +78,7 @@ extern "C" {
void nvicEnableVector(uint32_t n, uint32_t prio); void nvicEnableVector(uint32_t n, uint32_t prio);
void nvicDisableVector(uint32_t n); void nvicDisableVector(uint32_t n);
void nvicSetSystemHandlerPriority(uint32_t handler, uint32_t prio); void nvicSetSystemHandlerPriority(uint32_t handler, uint32_t prio);
void nvicClearPending(uint32_t n);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif