Fixes for READ_MULTIPLE and WRITE_MULTIPLE commands #115
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We may be transferring less data than can fit in a chunk, so we need to ensure that
xfer_cnt
is clamped to 0 when transferring the last chunk (otherwise it remains negative, andhas_data()
will return true).It's also possible that the transfer size is bigger than a chunk but not an even multiple of the chunk size, so we need to ensure that we don't try to transfer a whole chunk in the last iteration.
More correctly initialize the device identification struct, to report the maximum (word 47) and current (word 59) number of blocks that can be transferred with
READ_MULTIPLE
andWRITE_MULTIPLE
commands.Fix
post_xfer_action
to write the actual chunk size that was written, as opposed to an entire chunk (which may be larger).