diff options
author | Christian Pointner <equinox@spreadspace.org> | 2013-01-27 22:49:39 +0000 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2013-01-27 22:49:39 +0000 |
commit | 374a38c9d9e354c6e672da6c897edf405362e185 (patch) | |
tree | 1668010947896f0259e02c4fdf65afd24d52d34d /usb-i2c-sl018/update-keys.c | |
parent | filling unused key slots with 0xff (diff) |
sharing credit
git-svn-id: https://svn.spreadspace.org/avr/trunk@77 aa12f405-d877-488e-9caf-2d797e2a1cc7
Diffstat (limited to 'usb-i2c-sl018/update-keys.c')
-rw-r--r-- | usb-i2c-sl018/update-keys.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/usb-i2c-sl018/update-keys.c b/usb-i2c-sl018/update-keys.c index 5b80c97..9343c3c 100644 --- a/usb-i2c-sl018/update-keys.c +++ b/usb-i2c-sl018/update-keys.c @@ -27,6 +27,8 @@ #define KEY_LEN_MAX 7 #define MAX_KEYS 128 +/* this generates a Fletcher8 checksum */ +/* code from: http://stackoverflow.com/questions/13491700/8-bit-fletcher-checksum-of-16-byte-data */ char generate_csum(char* data) { uint16_t sum1 = 0xf, sum2 = 0xf, len = KEY_LEN_MAX; |