Skip to content
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

drivers/sdcard_spi: make use of crc16_ccitt_false_update() #18778

Merged

Conversation

benpicco
Copy link
Contributor

@benpicco benpicco commented Oct 19, 2022

Contribution description

Use crc16_ccitt instead of ucrc16.
This can be speed up by using a look-up table if desired and does not use more memory in the default configuration.

In fact, it saves some bytes compared to the generic CRC implementation:

before

   text	   data	    bss	    dec	    hex	
  62808	    892	  43688	 107388	  1a37c	

after

   text	   data	    bss	    dec	    hex	
  62744	    892	  43688	 107324	  1a33c	

Testing procedure

SD card still works:

2022-10-20 00:42:07,483 # main(): This is RIOT! (Version: 2023.01-devel-92-g10296)

> ls /sd0
2022-10-20 00:42:12,533 # test/
2022-10-20 00:42:12,534 # hello.txt	19 B
2022-10-20 00:42:12,536 # total 1 files

> vfs r /sd0/hello.txt
2022-10-20 00:45:13,936 # 00000000: 4865 6c6c 6f20 6672 6f6d 204c 696e 7578  Hello from Linux

Issues/PRs references

Use crc16_ccitt instead of ucrc16.
This can be speed up by using a look-up table if desired and does
not use more memory in the default configuration.
@github-actions github-actions bot added the Area: drivers Area: Device drivers label Oct 19, 2022
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Oct 19, 2022
@riot-ci
Copy link

riot-ci commented Oct 19, 2022

Murdock results

✔️ PASSED

f7197ba drivers/sdcard_spi: make use of crc16_ccitt_false_update()

Success Failures Total Runtime
1991 0 1991 06m:32s

Artifacts

This only reflects a subset of all builds from https://ci-prod.riot-os.org. Please refer to https://ci.riot-os.org for a complete build for now.

Copy link
Member

@maribu maribu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume that you have verified that the CRC is unchanged, e.g. by testing that the driver still works.

@benpicco
Copy link
Contributor Author

Sure, I posted the test results above :)

@benpicco benpicco merged commit 19d3ccc into RIOT-OS:master Oct 20, 2022
@benpicco benpicco deleted the drivers/sdcard_spi-crc16_ccitt_false branch October 20, 2022 14:45
@kaspar030 kaspar030 added this to the Release 2023.01 milestone Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants