2019-08-10 15:30:49 -04:00
|
|
|
/*
|
|
|
|
|
* File: main.c
|
|
|
|
|
* Author: justin
|
|
|
|
|
*
|
|
|
|
|
* Created on August 9, 2019, 6:14 PM
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <xc.h>
|
|
|
|
|
#include "usb.h"
|
2019-08-11 13:48:04 -04:00
|
|
|
#include "bootloader.h"
|
2019-08-10 15:30:49 -04:00
|
|
|
|
|
|
|
|
void main(void) {
|
2019-08-11 16:51:22 -04:00
|
|
|
//UserInit();
|
2019-08-11 13:48:04 -04:00
|
|
|
|
2019-08-10 15:30:49 -04:00
|
|
|
// 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
|
2019-08-11 13:48:04 -04:00
|
|
|
ProcessIO();
|
2019-08-10 15:30:49 -04:00
|
|
|
}
|
|
|
|
|
}
|