28 lines
544 B
C
28 lines
544 B
C
|
|
/*
|
||
|
|
* File: main.c
|
||
|
|
* Author: justin
|
||
|
|
*
|
||
|
|
* Created on August 9, 2019, 6:14 PM
|
||
|
|
*/
|
||
|
|
|
||
|
|
#include <xc.h>
|
||
|
|
#include "usb.h"
|
||
|
|
|
||
|
|
void main(void) {
|
||
|
|
// initialize the USB framework
|
||
|
|
USBDeviceInit();
|
||
|
|
USBDeviceAttach();
|
||
|
|
|
||
|
|
while(1)
|
||
|
|
{
|
||
|
|
USBDeviceTasks();
|
||
|
|
|
||
|
|
// do nothing if: not connected to USB host, or the host put us in suspend state
|
||
|
|
if((USBGetDeviceState() < CONFIGURED_STATE) | USBIsDeviceSuspended())
|
||
|
|
continue;
|
||
|
|
|
||
|
|
// run application specific tasks
|
||
|
|
//DANCEPAD_Tasks();
|
||
|
|
}
|
||
|
|
}
|