void ReinvokeISP(void)
{
// make sure USB clock is turned on before calling ISP
Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_USB);
// make sure GPIO clocks are turned on before calling ISP
Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_GPIO0);
Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_GPIO1);
Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_GPIO2);
// make sure IO configuration clock is turned on before calling ISP
Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_IOCON);
// make sure AHB clock divider is 1:1
Chip_Clock_SetSysClockDiv(1);
// Send Reinvoke ISP command to ISP entry point
command[0] = 57;
__disable_irq();
// Enter ISP. We call "iap_entry" to enter ISP because the ISP entry is done
// through the same command interface as IAP.
iap_entry(command, result);
// Not supposed to come back!
while(1);
} |