/* Check if a interrupt line is pending. 
Checks if the requested interrupt vector is pending. */
bool system_interrupt_is_pending(const enum system_interrupt_vector vector)
/* Check if a interrupt line is pending. 
Checks if the requested interrupt vector is pending. */
bool system_interrupt_is_pending(const enum system_interrupt_vector vector)
{
	bool result;
	if (vector >= _SYSTEM_INTERRUPT_EXTERNAL_VECTOR_START) {
		result = ((NVIC->ISPR[0] & (1 << vector)) != 0);
	} else if (vector == SYSTEM_INTERRUPT_SYSTICK) {
		result = ((SCB->ICSR & SCB_ICSR_PENDSTSET_Msk) != 0);
	} else {
		Assert(false);
		result = false;
	}
	return result;
}