Ejemplo n.º 1
0
/**
 * @brief	Handle interrupt from MRT
 * @return	Nothing
 */
void MRT_IRQHandler(void)
{
	uint32_t int_pend;

	/* Get interrupt pending status for all timers */
	int_pend = Chip_MRT_GetIntPending();
	Chip_MRT_ClearIntPending(int_pend);

	/* Channel 0 and 1 are periodic, toggle on either interrupt */
	if (int_pend & (MRTn_INTFLAG(0) | MRTn_INTFLAG(1))) {
		Board_LED_Toggle(0);
		t01++;
	}

	/* Channel 2 is single shot, reset it here */
	if (int_pend & (MRTn_INTFLAG(2))) {
		setupMRT(2, MRT_MODE_ONESHOT, 500);	/* Will fire in (1/500) seconds */
		Board_LED_Toggle(1);
		t2++;
	}

	/* Channel 3 is single shot, set flag so background loop resets it */
	if (int_pend & (MRTn_INTFLAG(3))) {
		t3Fired = false;
		t3++;
	}
}
Ejemplo n.º 2
0
/**
 * @brief	Handle interrupt from MRT
 * @return	Nothing
 */
void MRT_IRQHandler(void)
{
	uint32_t int_pend;

	/* Get and clear interrupt pending status for all timers */
	int_pend = Chip_MRT_GetIntPending();
	Chip_MRT_ClearIntPending(int_pend);

	/* Channel 0 */
	if (int_pend & MRTn_INTFLAG(0)) {
		Board_LED_Toggle(0);
	}

	/* Channel 1 */
	if (int_pend & MRTn_INTFLAG(1)) {
		Board_LED_Toggle(1);
	}

	/* Channel 2 is single shot, reset it here */
	if (int_pend & (MRTn_INTFLAG(2))) {
		setupMRT(2, MRT_MODE_ONESHOT, 2);	/* Will fire in 0.5 seconds */
		Board_LED_Toggle(2);
	}
}