int main ( void ) { // Initialize the processor and peripherals. if ( InitializeSystem() != TRUE ) { UART2PrintString( "\r\n\r\nCould not initialize USB Custom Demo App - system. Halting.\r\n\r\n" ); while (1); } if ( USBHostInit(0) == TRUE ) { UART2PrintString( "\r\n\r\n***** USB Custom Demo App Initialized *****\r\n\r\n" ); } else { UART2PrintString( "\r\n\r\nCould not initialize USB Custom Demo App - USB. Halting.\r\n\r\n" ); while (1); } btClientData.State = BT_STATE_IDLE; btClientData.Initialized = FALSE; mPORTAOutputConfig(0x3); mPORTAWrite(0x0); mPORTBOutputConfig(0x10); // OC 1 PPSOutput(PPS_RP4, PPS_OC1); //Enable Interrupt SetPriorityIntOC1(4); EnableIntOC1; OpenTimer2(T2_ON | T2_PS_1_8 ,0xffff); // OpenOC1(OC_IDLE_CON | OC_TIMER2_SRC | OC_PWM_EDGE_ALIGN ,OC_SYNC_TRIG_IN_TMR2,0,0); SetDCOC1PWM(0xc00,0); // Main Processing Loop while (1) { BTClientTasks(); // Maintain USB Host State USBHostTasks(); DelayMs(1); } return 0; } // main
static void BSP_IO_Init (void) { /* Each LED pin is set up as an output */ mPORTAOutputConfig((IOPORT_BIT_0 | IOPORT_BIT_1 | IOPORT_BIT_2 | IOPORT_BIT_3 | IOPORT_BIT_4 | IOPORT_BIT_5 | IOPORT_BIT_6 | IOPORT_BIT_7)); }