summaryrefslogtreecommitdiffstats
path: root/quantum
diff options
context:
space:
mode:
authorStefan Kerkmann <karlk90@pm.me>2021-07-02 23:28:32 +0200
committerGitHub <noreply@github.com>2021-07-02 22:28:32 +0100
commit04bc74d8f52370a01f1f67a5de8ae751e307e8c9 (patch)
treeda28538e8703c78c1a947f5d5c5ec25b95dc8f5f /quantum
parent638373a16c7111e21ccf41883850db6ba97c4475 (diff)
Switch split_common to CRC subsystem (#13418)
Diffstat (limited to 'quantum')
-rw-r--r--quantum/split_common/transactions.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/quantum/split_common/transactions.c b/quantum/split_common/transactions.c
index 99a8623b3c..abad626e00 100644
--- a/quantum/split_common/transactions.c
+++ b/quantum/split_common/transactions.c
@@ -17,6 +17,7 @@
#include <string.h>
#include <stddef.h>
+#include "crc.h"
#include "debug.h"
#include "matrix.h"
#include "quantum.h"
@@ -43,22 +44,6 @@
#define transport_write(id, data, length) transport_execute_transaction(id, data, length, NULL, 0)
#define transport_read(id, data, length) transport_execute_transaction(id, NULL, 0, data, length)
-static uint8_t crc8(const void *data, size_t len) {
- const uint8_t *p = (const uint8_t *)data;
- uint8_t crc = 0xff;
- size_t i, j;
- for (i = 0; i < len; i++) {
- crc ^= p[i];
- for (j = 0; j < 8; j++) {
- if ((crc & 0x80) != 0)
- crc = (uint8_t)((crc << 1) ^ 0x31);
- else
- crc <<= 1;
- }
- }
- return crc;
-}
-
#if defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER)
// Forward-declare the RPC callback handlers
void slave_rpc_info_callback(uint8_t initiator2target_buffer_size, const void *initiator2target_buffer, uint8_t target2initiator_buffer_size, void *target2initiator_buffer);