fet: fix packet size alignment when reading/writing buffers.

This commit is contained in:
Sören Höckner 2010-09-14 14:52:15 +12:00 committed by Daniel Beer
parent abc7b61737
commit 218ead5fe5
1 changed files with 4 additions and 0 deletions

4
fet.c
View File

@ -758,6 +758,8 @@ int fet_readmem(device_t dev_base, address_t addr, uint8_t *buffer,
while (count > 1) {
int plen = count > 128 ? 128 : count;
plen &= ~0x1;
if (xfer(dev, C_READMEMORY, NULL, 0, 2, addr, plen) < 0) {
printc_err("fet: failed to read "
"from 0x%04x\n", addr);
@ -799,6 +801,8 @@ int fet_writemem(device_t dev_base, address_t addr,
int plen = count > 128 ? 128 : count;
int ret;
plen &= ~0x1;
ret = xfer(dev, C_WRITEMEMORY, buffer, plen, 1, addr);
if (ret < 0) {