mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-16 21:28:33 +03:00
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.
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user