예제 #1
0
파일: USB.c 프로젝트: summerkaka/axio_mcb
void
Usb_Updater(void)
{
#if FW_UPDATE
    USBDCDTerm(0);
    CpuTimer0Regs.TCR.all = 0x0000; // Use write-only instruction to set TSS bit = 0
    CpuTimer1Regs.TCR.all = 0x0000; // Use write-only instruction to set TSS bit = 0
    EALLOW;
    DINT;
    IER = 0;
    IFR = 0;
    PieCtrlRegs.PIEIER1.bit.INTx4 = 0;      // Enable PIE Group 1 INT4  XINT
    PieCtrlRegs.PIEIER1.bit.INTx7 = 0;      // Enable PIE Group 1 INT7  TINT0
    DELAY_US(5L);
    PieCtrlRegs.PIEIER3.bit.INTx1 = 0;      // Enable PIE Group 3 INT1  PWM1
    PieCtrlRegs.PIEIER3.bit.INTx2 = 0;      // Enable PIE Group 3 INT2  PWM2
    PieCtrlRegs.PIEIER3.bit.INTx4 = 0;      // Enable PIE Group 3 INT4  PWM4
    PieCtrlRegs.PIEIER3.bit.INTx6 = 0;      // Enable PIE Group 3 INT4  PWM6
    DELAY_US(5L);
    PieCtrlRegs.PIEIER8.bit.INTx1 = 0;      // Enable PIE Group 8 INT1  I2CA NONE FIFO INT
    DELAY_US(5L);
    IER = 0;
    IFR = 0;
    PieCtrlRegs.PIEACK.all = 0x0fff;
    Usb0Regs.USBPOWER.bit.SOFT_CONN = 0;
    *(Uint32*)pAppSig = FW_UPDATE;
    GpioCtrlRegs.GPACTRL2.bit.USB0IOEN = 0;
    SysCtrlRegs.PCLKCR3.bit.USB0ENCLK = 0;
    DisablePeripherals();
    EDIS;

    if((unsigned long)pBootEntry != 0xFFFFFFFF && (unsigned long)pBootEntry != 0x00000000)
        ((void (*)(void))pBootEntry)();
#endif
}
예제 #2
0
/******************************************************************************
 * Function:        void UserInit(void)
 *
 * PreCondition:    None
 *
 * Input:           None
 *
 * Output:          None
 *
 * Side Effects:    None
 *
 * Overview:        This routine should take care of all of the demo code
 *                  initialization that is required.
 *
 * Note:
 *
 *****************************************************************************/
void UserInit(void)
{
    //Initialize all of the debouncing variables
    buttonCount = 0;
    buttonPressed = FALSE;
    stringPrinted = TRUE;

    //Initialize all of the LED pins
    mInitAllLEDs();

    //Initialize the pushbuttons
    mInitAllSwitches();

    // Initialize UART
    InitializeUSART();

    // Disable all unused peripherals
    DisablePeripherals();

    // Sleep until UART interrupt

}//end UserInit