diff options
author | Stefan Kerkmann <karlk90@pm.me> | 2021-06-18 01:09:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-18 00:09:43 +0100 |
commit | ef92c9ee2cf4745637635ec1895399e4f013914c (patch) | |
tree | 25184a0ad78399826ee585571e69b5df4beaa34b /tmk_core/common | |
parent | 67fa2568fe1f17942bf61462754e0be5a6bc3223 (diff) | |
download | qmk_firmware-ef92c9ee2cf4745637635ec1895399e4f013914c.tar.gz qmk_firmware-ef92c9ee2cf4745637635ec1895399e4f013914c.zip |
Add CRC8 calculation subsystem to quantum (#12641)
* 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.
Diffstat (limited to 'tmk_core/common')
-rw-r--r-- | tmk_core/common/keyboard.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c index 249da85bd..28fa97bc8 100644 --- a/tmk_core/common/keyboard.c +++ b/tmk_core/common/keyboard.c | |||
@@ -103,6 +103,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
103 | #ifdef EEPROM_DRIVER | 103 | #ifdef EEPROM_DRIVER |
104 | # include "eeprom_driver.h" | 104 | # include "eeprom_driver.h" |
105 | #endif | 105 | #endif |
106 | #if defined(CRC_ENABLE) | ||
107 | # include "crc.h" | ||
108 | #endif | ||
106 | 109 | ||
107 | static uint32_t last_input_modification_time = 0; | 110 | static uint32_t last_input_modification_time = 0; |
108 | uint32_t last_input_activity_time(void) { return last_input_modification_time; } | 111 | uint32_t last_input_activity_time(void) { return last_input_modification_time; } |
@@ -300,6 +303,9 @@ void keyboard_init(void) { | |||
300 | timer_init(); | 303 | timer_init(); |
301 | sync_timer_init(); | 304 | sync_timer_init(); |
302 | matrix_init(); | 305 | matrix_init(); |
306 | #if defined(CRC_ENABLE) | ||
307 | crc_init(); | ||
308 | #endif | ||
303 | #ifdef VIA_ENABLE | 309 | #ifdef VIA_ENABLE |
304 | via_init(); | 310 | via_init(); |
305 | #endif | 311 | #endif |