Don't freakout when wakeup-from-sleep fails during keyboard report out.

USG_1.0
Robert Fisk 8 years ago
parent 7a1fe0fb65
commit e63525f868

@ -139,9 +139,9 @@ USBD_ClassTypeDef* USBD_DeInit(USBD_HandleTypeDef *pdev)
pdev->pClass->DeInit(pdev, pdev->dev_config); pdev->pClass->DeInit(pdev, pdev->dev_config);
/* Stop the low level driver */ /* Stop the low level driver */
USBD_LL_Stop(pdev); // USBD_LL_Stop(pdev);
/* Initialize low level driver */ /* Deinitialize low level driver */
USBD_LL_DeInit(pdev); USBD_LL_DeInit(pdev);
return pdev->pClass; return pdev->pClass;

@ -294,12 +294,6 @@ static void Upstream_HID_SendControlReportCallback(UpstreamPacketTypeDef* receiv
return; return;
} }
if (KeyboardOutDataState != KEYBOARD_OUT_STATE_BUSY)
{
UPSTREAM_STATEMACHINE_FREAKOUT;
return;
}
if (receivedPacket == NULL) if (receivedPacket == NULL)
{ {
return; //Just give up... return; //Just give up...

@ -279,13 +279,13 @@ void Upstream_StateMachine_Wakeup(void)
return; return;
} }
//This is how I'd wakeup the host, IF IT ACTUALLY WORKED!
//USBD_LL_WakeupHost(&hUsbDeviceFS);
//This is really ugly! But wakeup seems to be broken on the STM32, so we do it the hard way. //This is really ugly! But wakeup seems to be broken on the STM32, so we do it the hard way.
activeClass = USBD_DeInit(&hUsbDeviceFS); activeClass = USBD_DeInit(&hUsbDeviceFS);
USB_Device_Init(); USB_Device_Init();
USBD_RegisterClass(&hUsbDeviceFS, activeClass); USBD_RegisterClass(&hUsbDeviceFS, activeClass);
USBD_Start(&hUsbDeviceFS); USBD_Start(&hUsbDeviceFS);
// This is how I'd wakeup the host, IF IT ACTUALLY WORKED!
// USBD_LL_WakeupHost(&hUsbDeviceFS);
} }

Loading…
Cancel
Save