int
main(void)
{
//
// Initialize board configurations
BoardInit();
//
// Pinmuxing for LEDs
//
PinMuxConfig();
//
// configure the LED RED and GREEN
//
GPIO_IF_LedConfigure(LED1|LED3);
GPIO_IF_LedOff(MCU_RED_LED_GPIO);
GPIO_IF_LedOff(MCU_GREEN_LED_GPIO);
//
// Base address for first timer
//
g_ulBase = TIMERA0_BASE;
//
// Base address for second timer
//
g_ulRefBase = TIMERA1_BASE;
//
// Configuring the timers
//
Timer_IF_Init(PRCM_TIMERA0, g_ulBase, TIMER_CFG_PERIODIC, TIMER_A, 0);
Timer_IF_Init(PRCM_TIMERA1, g_ulRefBase, TIMER_CFG_PERIODIC, TIMER_A, 0);
//
// Setup the interrupts for the timer timeouts.
//
Timer_IF_IntSetup(g_ulBase, TIMER_A, TimerBaseIntHandler);
Timer_IF_IntSetup(g_ulRefBase, TIMER_A, TimerRefIntHandler);
//
// Turn on the timers feeding values in mSec
//
Timer_IF_Start(g_ulBase, TIMER_A, 500);
Timer_IF_Start(g_ulRefBase, TIMER_A, 1000);
//
// Loop forever while the timers run.
//
while(FOREVER)
{
}
} |
感谢分享