Пример #1
0
// Main program entry point
void main(void)
{   
	// Initialise and configure the PIC ready to go
    initialisePic();



	// If we are running in interrupt mode attempt to attach the USB device
    #if defined(USB_INTERRUPT)
        USBDeviceAttach();
    #endif
	

	// Main processing loop
    while(1)
    {
        #if defined(USB_POLLING)
			// If we are in polling mode the USB device tasks must be processed here
			// (otherwise the interrupt is performing this task)
	        USBDeviceTasks();
        #endif
    	
    	// Process USB Commands
        processUsbCommands();  
        
        // Note: Other application specific actions can be placed here      
    }
}
Пример #2
0
// Main program entry point
void main(void)
{   
	UINT16 i;

	// Initialise and configure the PIC ready to go
    initialisePic();

	// If we are running in interrupt mode attempt to attach the USB device
    #if defined(USB_INTERRUPT)
        USBDeviceAttach();
    #endif
	
	// Initialise the debug log functions
    //debugInitialise();
    
    // Show that we are up and running
    //mStatusLED0_on();
	
/*	sprintf(debugString, "USB Generic HID Demonstration 3");
	debugOut(debugString);

	//sprintf(debugString, "(C)2011 Simon Inns - http://www.waitingforfriday.com");
	//debugOut(debugString);
	
	sprintf(debugString, "USB Device Initialised. ");
	debugOut(debugString);

	sprintf(debugString, "Initializing N64 Controller.");
	debugOut(debugString);

	InitController();
	sprintf(debugString, "N64 Controller Initialised.");
	debugOut(debugString);*/
	
	for(i = 0; i < 32000; i++);
	for(i = 0; i < 32000; i++);
	for(i = 0; i < 32000; i++);
	for(i = 0; i < 32000; i++);
	for(i = 0; i < 32000; i++);
	for(i = 0; i < 32000; i++);
	for(i = 0; i < 32000; i++);

	// Main processing loop
    while(1)
    {
        #if defined(USB_POLLING)
			// If we are in polling mode the USB device tasks must be processed here
			// (otherwise the interrupt is performing this task)
	        USBDeviceTasks();
        #endif
    	
    	// Process USB Commands
        processUsbCommands();  
        
        // Note: Other application specific actions can be placed here      
    }
}