/* Clear pending interrupt vector. 
Clear a pending interrupt vector, so the software handler is not executed. */
enum status_code system_interrupt_clear_pending(const enum system_interrupt_vector vector)
/* Clear pending interrupt vector. 
Clear a pending interrupt vector, so the software handler is not executed. */
enum status_code system_interrupt_clear_pending(const enum system_interrupt_vector vector)
{
	enum status_code status = STATUS_OK;
	if (vector >= _SYSTEM_INTERRUPT_EXTERNAL_VECTOR_START) {
		NVIC->ICPR[0] = (1 << vector);
	} else if (vector == SYSTEM_INTERRUPT_NON_MASKABLE) {
		return STATUS_ERR_INVALID_ARG;
	} else if (vector == SYSTEM_INTERRUPT_SYSTICK) {
		SCB->ICSR = SCB_ICSR_PENDSTCLR_Msk;
	} else {
		Assert(false);
		status = STATUS_ERR_INVALID_ARG;
	}
	return status;
}