Return the number of blocks completely read when querying read completion#12
Return the number of blocks completely read when querying read completion#12MichaelBell wants to merge 1 commit intoraspberrypi:masterfrom
Conversation
|
nice, yes i had planned such a feature! will take a look |
| } | ||
| check_crc_count = 0; | ||
| } | ||
| else if (blocks_complete) |
There was a problem hiding this comment.
I wonder if there should be a code-comment that blocks_complete will only be set when sd_scatter_read_complete returns false? 🤷
There was a problem hiding this comment.
I mean, I would've added a comment to the API if the API had any comments at all 🤣
| check_crc_count = 0; | ||
| } | ||
| else if (blocks_complete) | ||
| { |
There was a problem hiding this comment.
I do normally try to fit in with surrounding code's style, but I'm very much used to braces being on their own line! Will try to remember.
|
I've just realised that It should record the control words pointer passed into scatter_async and compare with that. I'll fix that and update the PR, hopefully today. |
yeah, the API is obviously not currenlty ideal :-) |
|
I'm going to switch to use the scatter read function directly in my video code. So, really I just want a call to get the number of control words that have been consumed. But that's not a particularly user friendly interface if you are using the normal methods. Options:
|
Especially when doing a longer async transfer, it can be useful to start reading it before it has finished.
This change allows the user to read the number of blocks already read by checking how far the chain DMA has got.
It's a breaking change, but I don't think there are many users yet, and you can just use NULL if you don't care.