/* leave DFU mode and reset device to jump to user loaded code  */
void dfu_mode_leave(void *pudev)
/* leave DFU mode and reset device to jump to user loaded code  */
void dfu_mode_leave(void *pudev)
{
    manifest_state = MANIFEST_COMPLETE;
    if (configuration_descriptor.DFU_Function_Desc.bmAttributes & 0x04) {
        dfu_status.bState = STATE_dfuMANIFEST_SYNC;
    } else {
        dfu_status.bState = STATE_dfuMANIFEST_WAIT_RESET;
        fmc_lock();
        NVIC_SystemReset();
    }
}