micropython / micropython/micropython-lib

RFC: cleanup of sdcard.py code

Open
#763 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.9k
Forks
1.1k
Avg merge
7d 6h
Merged PRs (30d)
3

Description

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.

sdcard_20231102_0752.zip

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the sdcard.py module, the linked discussion, and the attached sdcard_20231102_0752.zip prototype. Review the proposed adaptive timeout and CRC changes in that context, then seek maintainer feedback before defining what completion should mean; the issue does not specify an accepted scope or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
embedded-iot
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.