Skip to content

Commit

Permalink
DMA now working
Browse files Browse the repository at this point in the history
Seems that the class startup was happening at the wrong
point. It needs to happen when the lower stack calls the
ClassRequest callback. This fix also eliminates the
spurious Device Error callback.

Signed-off-by: Greg Burns <[email protected]>
  • Loading branch information
GregBurns committed Mar 5, 2024
1 parent 0312c80 commit 811a649
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ static USBH_StatusTypeDef USBH_MIDI_InterfaceDeInit(USBH_HandleTypeDef *phost)
*/
static USBH_StatusTypeDef USBH_MIDI_ClassRequest(USBH_HandleTypeDef *phost)
{
phost->pUser(phost, HOST_CLASS_REQUEST);
phost->pUser(phost, HOST_USER_CLASS_ACTIVE);
return USBH_OK;
}

Expand All @@ -159,7 +159,6 @@ static USBH_StatusTypeDef USBH_MIDI_Process(USBH_HandleTypeDef *phost)
switch (hMidi->state) {
case MIDI_INIT:
hMidi->state = MIDI_IDLE;
phost->pUser(phost, HOST_USER_CLASS_ACTIVE);
break;
case MIDI_IDLE:
hMidi->state = MIDI_RX;
Expand Down
2 changes: 1 addition & 1 deletion examples/MIDI_USBH_Input/MIDI_USBH_Input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ int main(void)
/** Initialize our hardware */
hw.Init();

hw.StartLog();
hw.StartLog(true);

hw.PrintLine("MIDI USB Host start");

Expand Down
2 changes: 1 addition & 1 deletion src/usbh/usbh_conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ USBH_StatusTypeDef USBH_LL_Init(USBH_HandleTypeDef *phost)
hhcd_USB_OTG_HS.Instance = USB_OTG_HS;
hhcd_USB_OTG_HS.Init.Host_channels = 16;
hhcd_USB_OTG_HS.Init.speed = HCD_SPEED_FULL;
hhcd_USB_OTG_HS.Init.dma_enable = DISABLE;
hhcd_USB_OTG_HS.Init.dma_enable = ENABLE;
hhcd_USB_OTG_HS.Init.phy_itface = USB_OTG_EMBEDDED_PHY;
hhcd_USB_OTG_HS.Init.Sof_enable = DISABLE;
hhcd_USB_OTG_HS.Init.low_power_enable = DISABLE;
Expand Down

0 comments on commit 811a649

Please sign in to comment.