RFC: cleanup of sdcard.py code
The sdcard.py module works, but seems a bit incomplete and slow. After quite a bit of discussion, https://github.com/orgs/micropython/discussions/12687 I have prepared a prototype of a newer scheme for it. It is much faster, since it uses an 'adaptive' timeout scheme (zero delays unless a bunch of fast delay loops have passed without data). It correctly implements crc7 on all commands, and allows the use of crc16 on data.
I have forked the repo, and am preparing a pull request. Before I go there, I would appreciate any commentary from the PTB about the changes. I am attaching a zip with the current status.
Thanks for any comments.
Here is a newer version to look at, if anyone is looking and testing. I have removed some redundant/dead code in the init_v1 and init_v2, so they are a single, inline block. This is approaching functional final, since I don't see anything else to trim. sdcard.20231104_0804.zip
This sounds good @mendenm ! I haven't followed the discussion thread in detail, but I get the impression that this should address many of the common issues that people run into with this library. Looking forward to seeing the PR.
Edit: I see the PR is here #765 Thanks!