IntPrioritySet(INT_GPIOB, 0x20);
IntPrioritySet(INT_GPIOD, 0x20);
IntPrioritySet(INT_TIMER0A, 0x20);
IntPrioritySet(INT_WATCHDOG, 0x40);
IntPrioritySet(INT_ADC0SS0, 0x60);
IntPrioritySet(INT_PWM0, 0x80);
IntPrioritySet(INT_PWM1, 0xa0);
IntPrioritySet(INT_PWM2, 0xc0);
IntPrioritySet(FAULT_SYSTICK, 0xc0);
IntPrioritySet(INT_UART0, 0xe0);
UART_Init();
PWMInit(); // Initialize the PWM driver.
ADCInit(); // Initialize the ADC.
HallInit(); // Initialize the Hall Sensor control routines.
UIInit(); // Initialize the user interface.
// ENET_Init(); // Initialize the Ethernet
MainClearFaults(); // Clear any fault conditions that may have erroneously triggered as the ADC started acquiring readings
UIRunLEDBlink(200, 25); // Indicate that the motor drive is stopped.
IntEnable(INT_WATCHDOG); // Initialize the Watchdog timer for a 100ms timeout.
WatchdogReloadSet(WATCHDOG0_BASE, WATCHDOG_RELOAD_VALUE);
WatchdogResetEnable(WATCHDOG0_BASE);
WatchdogEnable(WATCHDOG0_BASE);
TimerConfigure(TIMER0_BASE, TIMER_CFG_32_BIT_OS);
TimerIntEnable(TIMER0_BASE, TIMER_TIMA_TIMEOUT);
IntEnable(INT_TIMER0A);