started porting over the actual bootloader code from the MLA demo

This commit is contained in:
2019-08-11 13:48:04 -04:00
parent c36474131b
commit 75d70c5200
6 changed files with 1277 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
#include "usb.h"
#include "usb_device_hid.h"
#include "bootloader.h"
/*******************************************************************
* Function: bool USER_USB_CALLBACK_EVENT_HANDLER(
@@ -53,7 +54,9 @@ bool USER_USB_CALLBACK_EVENT_HANDLER(USB_EVENT event, void *pdata, uint16_t size
case EVENT_CONFIGURED:
// When the device is configured, we should (re)initialize our state variables
USBEnableEndpoint(1, USB_IN_ENABLED|USB_HANDSHAKE_ENABLED|USB_DISALLOW_SETUP);
UserInit();
USBEnableEndpoint(HID_IN_EP, USB_IN_ENABLED|USB_HANDSHAKE_ENABLED|USB_DISALLOW_SETUP);
USBEnableEndpoint(HID_OUT_EP, USB_OUT_ENABLED|USB_HANDSHAKE_ENABLED|USB_DISALLOW_SETUP);
break;
case EVENT_SET_DESCRIPTOR: