aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/atmel_softpack_libraries
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-11-29 00:24:28 +0100
committerHarald Welte <laforge@gnumonks.org>2017-11-29 00:24:28 +0100
commit7f62c24532be56a680a9ff8ce13039874104b551 (patch)
tree61276bcf24656554bbb478df9434a0ea726b7808 /firmware/atmel_softpack_libraries
parent75cf93e04d23b0825ee777766d65ad5792e9058d (diff)
USB: Handle DFU requests by USBD.c to keep application callback
e.g. in CCID mode we need to treat class-specific control requests, and we want to do this in a way how the CCID code doesn't need to understand about DFU.
Diffstat (limited to 'firmware/atmel_softpack_libraries')
-rw-r--r--firmware/atmel_softpack_libraries/usb/device/core/USBD.c6
-rw-r--r--firmware/atmel_softpack_libraries/usb/device/dfu/dfu_runtime.c8
2 files changed, 7 insertions, 7 deletions
diff --git a/firmware/atmel_softpack_libraries/usb/device/core/USBD.c b/firmware/atmel_softpack_libraries/usb/device/core/USBD.c
index 422c275..bd39a53 100644
--- a/firmware/atmel_softpack_libraries/usb/device/core/USBD.c
+++ b/firmware/atmel_softpack_libraries/usb/device/core/USBD.c
@@ -47,6 +47,8 @@
#include "USBD.h"
#include "USBD_HAL.h"
+extern void USBDFU_Runtime_RequestHandler(const USBGenericRequest *request);
+
/*---------------------------------------------------------------------------
* Definitions
*---------------------------------------------------------------------------*/
@@ -144,7 +146,11 @@ void USBD_RequestHandler(uint8_t bEndpoint,
bEndpoint);
}
else {
+#if defined(BOARD_USB_DFU) && !defined(APPLICATION_dfu)
+ USBDFU_Runtime_RequestHandler(pRequest);
+#else
USBDCallbacks_RequestReceived(pRequest);
+#endif
}
}
diff --git a/firmware/atmel_softpack_libraries/usb/device/dfu/dfu_runtime.c b/firmware/atmel_softpack_libraries/usb/device/dfu/dfu_runtime.c
index 4d8330f..177a740 100644
--- a/firmware/atmel_softpack_libraries/usb/device/dfu/dfu_runtime.c
+++ b/firmware/atmel_softpack_libraries/usb/device/dfu/dfu_runtime.c
@@ -141,7 +141,7 @@ void USBDFU_Runtime_RequestHandler(const USBGenericRequest *request)
if (USBGenericRequest_GetType(request) != USBGenericRequest_CLASS ||
USBGenericRequest_GetRecipient(request) != USBGenericRequest_INTERFACE) {
TRACE_DEBUG("std_ho_usbd ");
- USBDDriver_RequestHandler(usbdDriver, request);
+ USBDCallbacks_RequestReceived(request);
return;
}
@@ -216,9 +216,3 @@ void DFURT_SwitchToDFU(void)
* ResetVector of the bootloader */
NVIC_SystemReset();
}
-
-void USBDCallbacks_RequestReceived(const USBGenericRequest *request)
-{
- /* FIXME: integration with CCID control point reqeusts */
- USBDFU_Runtime_RequestHandler(request);
-}