ata_write_sectors() didn't handle odd buffer addresses

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3544 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2003-04-12 23:02:58 +00:00
parent 1326f666a6
commit b5401749cb

View file

@ -376,8 +376,11 @@ int ata_write_sectors(unsigned long start,
poweroff = false;
}
for (j=0; j<SECTOR_SIZE/2; j++)
ATA_DATA = SWAB16(((unsigned short*)buf)[j]);
for (j=0; j<SECTOR_SIZE/2; j++) {
ATA_DATA = (unsigned short)
(((unsigned char *)buf)[j*2+1] << 8) |
((unsigned char *)buf)[j*2];
}
#ifdef USE_INTERRUPT
/* reading the status register clears the interrupt */