Skip to content

In adafruit_sdcard.py, calculate_crc() re-create the CRC table each call, slowing all things down #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Anton-2 opened this issue Oct 14, 2019 · 3 comments

Comments

@Anton-2
Copy link
Contributor

Anton-2 commented Oct 14, 2019

calculate_crc() uses a computed crc_table to speed crc calculation up.

But this crc_table is calculated each time, for each command sent to the card, when it should be calculated once on module loading.

Moving this calculation at modules level helps making adafruit_sdcard.py faster.

@ladyada
Copy link
Member

ladyada commented Oct 14, 2019

oh wow yeah! do you want to try submitting a PR for this, and testing it on your pygamer? then we could merge it in :)

@Anton-2
Copy link
Contributor Author

Anton-2 commented Oct 16, 2019

Done in #23

@Anton-2
Copy link
Contributor Author

Anton-2 commented Oct 19, 2019

Fixed in 21b7528, thanks for merging !

@Anton-2 Anton-2 closed this as completed Oct 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants