/* This function is a re-implementation of the Altera provided function. The function is re-implemented to prevent it from enabling an interrupt when it is registered. Interrupts should only be enabled after the FreeRTOS.org kernel has its scheduler started so that contexts are saved and switched correctly.  */
int alt_irq_register(alt_u32 id, void *context, void(*handler)(void *, alt_u32))
/* This function is a re-implementation of the Altera provided function. The function is re-implemented to prevent it from enabling an interrupt when it is registered. Interrupts should only be enabled after the FreeRTOS.org kernel has its scheduler started so that contexts are saved and switched correctly.  */
int alt_irq_register(alt_u32 id, void *context, void(*handler)(void *, alt_u32))
{
	int rc = -EINVAL;  
	alt_irq_context status;
	if (id < ALT_NIRQ)
	{
		status = alt_irq_disable_all ();
		alt_irq[id].handler = handler;
		alt_irq[id].context = context;
		rc = (handler) ? alt_irq_enable (id): alt_irq_disable (id);
	}
	return rc; 
}