diff options
-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 |