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

sys/checksum: add CRC-16 implementation without lookup table #18701

Merged
merged 2 commits into from Oct 7, 2022

Conversation

benpicco
Copy link
Contributor

@benpicco benpicco commented Oct 6, 2022

Contribution description

The look-up table for CRC-16 can be quite heavy, so also provide an implementation without it.
The look-up table can be enabled with the crc16_fast pseudo-module.

Since this removes @jue89's concern with the common implementation, also use it in DOSE instead of re-implementing CRC-16 there. (DOSE's CRC-16 implementation is now the common one without the look-up table).

Testing procedure

The tests-checksum unittest still works with and without crc16_fast.

Issues/PRs references

@benpicco benpicco marked this pull request as ready for review October 6, 2022 15:51
@github-actions github-actions bot added Area: build system Area: Build system Area: drivers Area: Device drivers Area: Kconfig Area: Kconfig integration Area: sys Area: System labels Oct 6, 2022
@benpicco benpicco requested a review from maribu October 6, 2022 15:52
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.

ACK. Code looks good. I assume you have checked for correctness (e.g. by having one DOSE device successfully communicating with another and only one is using fast CRC16-CCITT)?

@maribu
Copy link
Member

maribu commented Oct 6, 2022

The tests-checksum unittest still works with and without crc16_fast.

Ah, perfect! :)

@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 6, 2022
@riot-ci
Copy link

riot-ci commented Oct 6, 2022

Murdock results

✔️ PASSED

98e18ed drivers/dose: make use of checksum module

Success Failures Total Runtime
1980 0 1980 06m:23s

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.

@benpicco benpicco merged commit 24f7d20 into RIOT-OS:master Oct 7, 2022
@benpicco benpicco deleted the sys/checksum-crc16_fast branch October 7, 2022 10:31
@maribu maribu added this to the Release 2022.10 milestone Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: build system Area: Build system Area: drivers Area: Device drivers Area: Kconfig Area: Kconfig integration Area: sys Area: System 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.

None yet

3 participants