diff options
author | Amir Hammad <amir.hammad@hotmail.com> | 2015-08-26 07:33:35 +0200 |
---|---|---|
committer | Amir Hammad <amir.hammad@hotmail.com> | 2015-08-26 07:46:00 +0200 |
commit | 4abcb07a755af940909bf615fedeb175ba7f6223 (patch) | |
tree | 9b2d467971e14ae5d04decc0c04901f774c520a3 | |
parent | 9f0651caf96babe314cd73ccbbe6aee2aa0bfe36 (diff) | |
download | secure-hid-4abcb07a755af940909bf615fedeb175ba7f6223.tar.gz secure-hid-4abcb07a755af940909bf615fedeb175ba7f6223.tar.bz2 secure-hid-4abcb07a755af940909bf615fedeb175ba7f6223.zip |
lld/stm32f4: fix bug, setting wrong eptyp field
it was always 0 - control transfer...
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
-rw-r--r-- | src/usbh_lld_stm32f4.c | 11 |
1 files 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);
}
|