1
0
mirror of https://github.com/hathach/tinyusb.git synced 2025-03-24 16:43:39 +00:00

more endian convert

This commit is contained in:
hathach 2019-05-14 13:06:38 +07:00
parent 3e6d911ce9
commit 454496316f
No known key found for this signature in database
GPG Key ID: 2FA891220FBFD581

@ -233,7 +233,7 @@ tusb_error_t tuh_msc_read10(uint8_t dev_addr, uint8_t lun, void * p_buffer, uin
{ {
.cmd_code = SCSI_CMD_READ_10, .cmd_code = SCSI_CMD_READ_10,
.lba = tu_htonl(lba), .lba = tu_htonl(lba),
.block_count = tu_u16_le2be(block_count) .block_count = tu_htons(block_count)
}; };
memcpy(p_msch->cbw.command, &cmd_read10, p_msch->cbw.cmd_len); memcpy(p_msch->cbw.command, &cmd_read10, p_msch->cbw.cmd_len);
@ -259,7 +259,7 @@ tusb_error_t tuh_msc_write10(uint8_t dev_addr, uint8_t lun, void const * p_buffe
{ {
.cmd_code = SCSI_CMD_WRITE_10, .cmd_code = SCSI_CMD_WRITE_10,
.lba = tu_htonl(lba), .lba = tu_htonl(lba),
.block_count = tu_u16_le2be(block_count) .block_count = tu_htons(block_count)
}; };
memcpy(p_msch->cbw.command, &cmd_write10, p_msch->cbw.cmd_len); memcpy(p_msch->cbw.command, &cmd_write10, p_msch->cbw.cmd_len);