Verify the integrity of key state update messages using CRC16-CCITT.

This commit is contained in:
László Monda
2017-05-31 03:26:50 +02:00
parent 57319489d2
commit 1e290ebc34
6 changed files with 38 additions and 3 deletions

View File

@@ -4,6 +4,7 @@
// Includes:
#include "fsl_port.h"
#include "crc16.h"
// Macros:
@@ -14,7 +15,8 @@
#define PROTOCOL_RESPONSE_GENERIC_ERROR 1
#define LEFT_KEYBOARD_HALF_KEY_COUNT (KEYBOARD_MATRIX_COLS_NUM*KEYBOARD_MATRIX_ROWS_NUM)
#define KEY_STATE_BUFFER_SIZE (LEFT_KEYBOARD_HALF_KEY_COUNT/8 + 1)
#define KEY_STATE_SIZE (LEFT_KEYBOARD_HALF_KEY_COUNT/8 + 1)
#define KEY_STATE_BUFFER_SIZE (KEY_STATE_SIZE + CRC16_HASH_LENGTH)
// Variables: