diff options
author | Dmitry Filimonchuk <dmitrystu@gmail.com> | 2021-11-15 13:06:40 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-15 13:06:40 +0300 |
commit | c3bcfc9456ebd9b5fc6db8010a431fe8a94814cc (patch) | |
tree | 36324600fe7169a3dfc09e512af4dde435ce78ab | |
parent | 0a0a24f590844a9dab1557be054d43c128d0d0a8 (diff) |
Fix L1 PMA access (#104)
* Fix L1 PMA step
* fix EP size calculus in the ASM driver for the L1
closes #103
-rw-r--r-- | src/usbd_stm32l100_devfs.c | 6 | ||||
-rw-r--r-- | src/usbd_stm32l100_devfs_asm.S | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/usbd_stm32l100_devfs.c b/src/usbd_stm32l100_devfs.c index 29bd259..d64d7f5 100644 --- a/src/usbd_stm32l100_devfs.c +++ b/src/usbd_stm32l100_devfs.c @@ -261,7 +261,8 @@ static uint16_t pma_read (uint8_t *buf, uint16_t blen, pma_rec *rx) { rx->cnt &= ~0x3FF; for(int idx = 0; idx < rxcnt; idx++) { if ((idx & 0x01) == 0) { - tmp = *pma++; + tmp = *pma; + pma += 2; } if (idx < blen) { buf[idx] = tmp & 0xFF; @@ -323,7 +324,8 @@ static void pma_write(const uint8_t *buf, uint16_t blen, pma_rec *tx) { for (int idx=0; idx < blen; idx++) { tmp |= buf[idx] << ((idx & 0x01) ? 8 : 0); if ((idx & 0x01) || (idx + 1) == blen) { - *pma++ = tmp; + *pma = tmp; + pma += 2; tmp = 0; } } diff --git a/src/usbd_stm32l100_devfs_asm.S b/src/usbd_stm32l100_devfs_asm.S index dc3c48b..5820a3d 100644 --- a/src/usbd_stm32l100_devfs_asm.S +++ b/src/usbd_stm32l100_devfs_asm.S @@ -629,7 +629,7 @@ _ep_config: movs r3, #0x1F adds r2, r3 bics r2, r3 - lsrs r3, r2, #5 + lsrs r3, r2, #4 adds r3, #0x3E .L_epc_rxbb: lsls r3, #9 |