/* Set an interrupt handler for the specified interrput source.  */
void ipc_set_handler(Ipc *p_ipc, enum ipc_interrupt_source source, void(*p_handler)(Ipc *, enum ipc_interrupt_source))
/* Set an interrupt handler for the specified interrput source.  */
void ipc_set_handler(Ipc *p_ipc, enum ipc_interrupt_source source, void(*p_handler)(Ipc *, enum ipc_interrupt_source))
{
	struct ipc_interrupt_handler *pSource;
	uint32_t i = 0;
	while (!(source & (1 << i))) {
		i++;
	}
	if (p_ipc == IPC0) {
		pSource = &(ipc_handler[0][i]);
	} else {
		pSource = &(ipc_handler[1][i]);
	}
	pSource->mask = source;
	pSource->handler = p_handler;
}