fix byte_block_count error in byte mode

Signed-off-by: zhanghu5 <zhanghu5@xiaomi.com>
This commit is contained in:
zhanghu5 2023-07-20 11:18:56 +08:00 committed by Xiang Xiao
parent d98bfc3e49
commit a69b6846e6
1 changed files with 2 additions and 2 deletions

View File

@ -252,12 +252,12 @@ int sdio_io_rw_extended(FAR struct sdio_dev_s *dev, bool write,
arg.cmd53.function_number = function & 7; arg.cmd53.function_number = function & 7;
arg.cmd53.rw_flag = write; arg.cmd53.rw_flag = write;
if (nblocks == 0 && blocklen < 512) if (nblocks == 0)
{ {
/* Use byte mode */ /* Use byte mode */
arg.cmd53.block_mode = 0; arg.cmd53.block_mode = 0;
arg.cmd53.byte_block_count = blocklen; arg.cmd53.byte_block_count = (blocklen == 512) ? 0 : blocklen;
nblocks = 1; nblocks = 1;
} }
else else