Tentative USBv1 and USBv2 fix about wrong size of PMA buffers larger than 62.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@16214 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
parent
ccdceba6a7
commit
dfaec14d06
|
@ -639,11 +639,13 @@ void usb_lld_init_endpoint(USBDriver *usbp, usbep_t ep) {
|
||||||
uint16_t nblocks;
|
uint16_t nblocks;
|
||||||
|
|
||||||
/* Endpoint size and address initialization.*/
|
/* Endpoint size and address initialization.*/
|
||||||
if (epcp->out_maxsize > 62)
|
if (epcp->out_maxsize > 62) {
|
||||||
nblocks = (((((epcp->out_maxsize - 1U) | 0x1FU) + 1U) / 32U) << 10) |
|
nblocks = (((((uint32_t)epcp->out_maxsize - 1U) | 0x1FU) / 32U) << 10) |
|
||||||
0x8000;
|
0x8000U;
|
||||||
else
|
}
|
||||||
nblocks = ((((epcp->out_maxsize - 1U) | 1U) + 1U) / 2U) << 10;
|
else {
|
||||||
|
nblocks = ((((uint32_t)(epcp->out_maxsize - 1U) | 1U) + 1U) / 2U) << 10;
|
||||||
|
}
|
||||||
dp->RXCOUNT0 = nblocks;
|
dp->RXCOUNT0 = nblocks;
|
||||||
dp->RXADDR0 = usb_pm_alloc(usbp, epcp->out_maxsize);
|
dp->RXADDR0 = usb_pm_alloc(usbp, epcp->out_maxsize);
|
||||||
|
|
||||||
|
|
|
@ -753,7 +753,7 @@ void usb_lld_init_endpoint(USBDriver *usbp, usbep_t ep) {
|
||||||
|
|
||||||
/* Endpoint size and address initialization.*/
|
/* Endpoint size and address initialization.*/
|
||||||
if (epcp->out_maxsize > 62U) {
|
if (epcp->out_maxsize > 62U) {
|
||||||
nblocks = ((((((uint32_t)epcp->out_maxsize - 1U) | 0x1FU) + 1U) / 32U) << 26) |
|
nblocks = (((((uint32_t)epcp->out_maxsize - 1U) | 0x1FU) / 32U) << 26) |
|
||||||
0x80000000U;
|
0x80000000U;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in New Issue