Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/flipperdevices/libusb_stm32.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDmitry Filimonchuk <dmitrystu@gmail.com>2021-11-05 22:59:24 +0300
committerDmitry Filimonchuk <dmitrystu@gmail.com>2021-11-08 15:39:43 +0300
commit9a82199f2c925fa9387f018a1db21302a4b96234 (patch)
treef312cbfba48d7e014c04365343de6ffeeebac115 /src
parent75c581119b99c86d302e612fad78b65f492f27eb (diff)
Add F411E demo, macro fixes
Diffstat (limited to 'src')
-rw-r--r--src/usbd_stm32f429_otghs.c7
-rw-r--r--src/usbd_stm32f446_otgfs.c2
2 files changed, 5 insertions, 4 deletions
diff --git a/src/usbd_stm32f429_otghs.c b/src/usbd_stm32f429_otghs.c
index edab38f..ba21948 100644
--- a/src/usbd_stm32f429_otghs.c
+++ b/src/usbd_stm32f429_otghs.c
@@ -354,9 +354,10 @@ static int32_t ep_write(uint8_t ep, void *buf, uint16_t blen) {
}
_BMD(epi->DIEPTSIZ,
USB_OTG_DIEPTSIZ_PKTCNT | USB_OTG_DIEPTSIZ_MULCNT | USB_OTG_DIEPTSIZ_XFRSIZ,
- _VAL2FLD(USB_OTG_DIEPTSIZ_PKTCNT, 1) | _VAL2FLD(USB_OTG_DIEPTSIZ_MULCNT, 1 ) | _VAL2FLD(USB_OTG_DIEPTSIZ_XFRSIZ, blen));
- _BMD(epi->DIEPCTL, USB_OTG_DIEPCTL_STALL, USB_OTG_DOEPCTL_CNAK);
- _BST(epi->DIEPCTL, USB_OTG_DOEPCTL_EPENA);
+ _VAL2FLD(USB_OTG_DIEPTSIZ_PKTCNT, 1) | _VAL2FLD(USB_OTG_DIEPTSIZ_MULCNT, 1 ) |
+ _VAL2FLD(USB_OTG_DIEPTSIZ_XFRSIZ, blen));
+ _BMD(epi->DIEPCTL, USB_OTG_DIEPCTL_STALL, USB_OTG_DIEPCTL_CNAK);
+ _BST(epi->DIEPCTL, USB_OTG_DIEPCTL_EPENA);
/* push data to FIFO */
tmp = 0;
for (int idx = 0; idx < blen; idx++) {
diff --git a/src/usbd_stm32f446_otgfs.c b/src/usbd_stm32f446_otgfs.c
index 93cb2c3..7ffeb4f 100644
--- a/src/usbd_stm32f446_otgfs.c
+++ b/src/usbd_stm32f446_otgfs.c
@@ -345,7 +345,7 @@ static int32_t ep_write(uint8_t ep, void *buf, uint16_t blen) {
}
epi->DIEPTSIZ = 0;
epi->DIEPTSIZ = (1 << 19) + blen;
- _BMD(epi->DIEPCTL, USB_OTG_DIEPCTL_STALL, USB_OTG_DOEPCTL_EPENA | USB_OTG_DOEPCTL_CNAK);
+ _BMD(epi->DIEPCTL, USB_OTG_DIEPCTL_STALL, USB_OTG_DIEPCTL_EPENA | USB_OTG_DIEPCTL_CNAK);
/* push data to FIFO */
tmp = 0;
for (int idx = 0; idx < blen; idx++) {