From 4abcb07a755af940909bf615fedeb175ba7f6223 Mon Sep 17 00:00:00 2001 From: Amir Hammad Date: Wed, 26 Aug 2015 07:33:35 +0200 Subject: lld/stm32f4: fix bug, setting wrong eptyp field it was always 0 - control transfer... Signed-off-by: Amir Hammad --- src/usbh_lld_stm32f4.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/usbh_lld_stm32f4.c b/src/usbh_lld_stm32f4.c index 817df2e..2ad8190 100644 --- a/src/usbh_lld_stm32f4.c +++ b/src/usbh_lld_stm32f4.c @@ -160,11 +160,16 @@ static void stm32f4_usbh_port_channel_setup( eptyp = OTG_HCCHAR_EPTYP_BULK; break; case USBH_EPTYP_INTERRUPT: - eptyp = OTG_HCCHAR_EPTYP_INTERRUPT; + // Use bulk transfer also for interrupt, since no difference is on protocol layer + // Except different behaviour of the core + eptyp = OTG_HCCHAR_EPTYP_BULK; break; case USBH_EPTYP_ISOCHRONOUS: eptyp = OTG_HCCHAR_EPTYP_ISOCHRONOUS; break; + default: + LOG_PRINTF("\n\n\n\nWRONG EP TYPE\n\n\n\n\n"); + return; } uint32_t speed = 0; @@ -175,10 +180,10 @@ static void stm32f4_usbh_port_channel_setup( REBASE_CH(OTG_HCCHAR, channel) = OTG_HCCHAR_CHENA | (OTG_HCCHAR_DAD_MASK & (address << 22)) | OTG_HCCHAR_MCNT_1 | - (OTG_HCCHAR_EPTYP_MASK & (eptyp << 18)) | + (OTG_HCCHAR_EPTYP_MASK & (eptyp)) | (speed) | (epdir) | - (OTG_HCCHAR_EPNUM_MASK & (epnum << 11) )| + (OTG_HCCHAR_EPNUM_MASK & (epnum << 11)) | (OTG_HCCHAR_MPSIZ_MASK & max_packet_size); } -- cgit