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:
Harald Welte
2017-02-28 00:21:45 +01:00
parent edf9c9d322
commit 32852bc1d9
5 changed files with 108 additions and 13 deletions

View File

@@ -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);
}

View File

@@ -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);
}