-
-
Notifications
You must be signed in to change notification settings - Fork 39.6k
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
[Core] Add CRC8 calculation subsystem to quantum #12641
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just what I always wanted.
Thanks for helping get this stuff over the line!
For clarity, I'd been in discussion with @KarlK90 who had implemented the CRC8 using on-chip hardware -- I suggested that perhaps we formalise the CRC "subsystem" so that we can start adding things like the ChibiOS hardware drivers down the line. |
For reference this is what a hardware implementation could look like. From personal testing the fast table based crc8 implementation is faster. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__attribute__((weak))
✅
Also, has merge conflict |
Fixed! For reference CRC8 table algorithm was generated by https://pycrc.org/. |
* Intended usage is data validation in split transport code. * Default space efficient algorithm. * Opt-in fast table based algorithmn with #define CRC8_USE_TABLE switch. * Define switches for size and speed optimized versions, the default is size optimized by using uint_least8_t as datatype for calculations. * #define CRC8_OPTIMIZE_SPEED uses uint_fast8_t as datatype for calculations, this only affects 32-bit Archs like ARM and RISC-V. * Placeholder crc_init() function for hardware backed crc calculation, not implemented yet.
* Intended usage is data validation in split transport code. * Default space efficient algorithm. * Opt-in fast table based algorithmn with #define CRC8_USE_TABLE switch. * Define switches for size and speed optimized versions, the default is size optimized by using uint_least8_t as datatype for calculations. * #define CRC8_OPTIMIZE_SPEED uses uint_fast8_t as datatype for calculations, this only affects 32-bit Archs like ARM and RISC-V. * Placeholder crc_init() function for hardware backed crc calculation, not implemented yet.
* Intended usage is data validation in split transport code. * Default space efficient algorithm. * Opt-in fast table based algorithmn with #define CRC8_USE_TABLE switch. * Define switches for size and speed optimized versions, the default is size optimized by using uint_least8_t as datatype for calculations. * #define CRC8_OPTIMIZE_SPEED uses uint_fast8_t as datatype for calculations, this only affects 32-bit Archs like ARM and RISC-V. * Placeholder crc_init() function for hardware backed crc calculation, not implemented yet.
#define CRC8_USE_TABLE
switch.uint_least8_t
as datatype for calculations.#define CRC8_OPTIMIZE_SPEED
usesuint_fast8_t
as datatype for calculations, this only affects 32-bit Archs like ARM and RISC-V.crc_init()
function for hardware backed crc calculation, not implemented yet.Types of Changes
Issues Fixed or Closed by This PR
Checklist