mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-16 21:28:33 +03:00
DFU: towards a more complete implementation
* we now actually route the EP0 control requests in DFU mode to the correct handler (weak linker symbols are tricky) * we now actually call code to read/write data from/to RAM/FLASH
This commit is contained in:
@@ -438,15 +438,18 @@ out:
|
||||
}
|
||||
}
|
||||
|
||||
/* we assume the caller has enabled the required clock/PLL for USB */
|
||||
void USBDFU_Initialize(const USBDDriverDescriptors *pDescriptors)
|
||||
{
|
||||
/* We already start in DFU idle mode */
|
||||
g_dfu.state = DFU_STATE_dfuIDLE;
|
||||
|
||||
USBDDriver_Initialize(&usbdDriver, pDescriptors, if_altsettings);
|
||||
|
||||
USBD_Init();
|
||||
USBD_Connect();
|
||||
//USBD_ConfigureSpeed(1);
|
||||
|
||||
NVIC_EnableIRQ(UDP_IRQn);
|
||||
}
|
||||
|
||||
void USBDFU_SwitchToApp(void)
|
||||
@@ -464,3 +467,8 @@ void USBDFU_SwitchToApp(void)
|
||||
//BootIntoApp();
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
|
||||
void USBDCallbacks_RequestReceived(const USBGenericRequest *request)
|
||||
{
|
||||
USBDFU_DFU_RequestHandler(request);
|
||||
}
|
||||
|
||||
@@ -187,3 +187,9 @@ void DFURT_SwitchToDFU(void)
|
||||
|
||||
toDFU();
|
||||
}
|
||||
|
||||
void USBDCallbacks_RequestReceived(const USBGenericRequest *request)
|
||||
{
|
||||
/* FIXME: integration with CCID control point reqeusts */
|
||||
USBDFU_Runtime_RequestHandler(request);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user