Question: what is the purpose of `spi->could_be_busy`?
g-berthiaume opened this issue · 2 comments
I'm trying to understand in what situation the spi->busy_pre_check
routine would be executed.`
This flag seems to be set in only one condition:
if (spi->could_be_busy) {
spi->busy_pre_check = 1;
}
The spi->could_be_busy
flag does not seems to get set anywhere.
In what case would the busy_pre_check would be triggered?
Am I missing something?
Thanks for this great library.
Hi, it was some time since I wrote this, but I have a vague recollection of that the user can set could_be_busy if there are other drivers acting on the spi flash also. If not, and this driver is the lone and only actor, it is always false and we do not need to waste time checking the busy flag.
I'll add a comment in near future. Thanks for pointing this out, and thanks for the kind words. 🙏
Thanks for your answer.
I did not understand this use case.
It was a pleasure to read your code. I like the way you decoupled the sync
and async
.