Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: WiiNunchuck mbed-dev
Revision 2:6e0dfe2caf48, committed 2016-10-23
- Comitter:
- Thomas_H
- Date:
- Sun Oct 23 19:38:35 2016 +0000
- Parent:
- 1:5acd27cb1857
- Commit message:
- removed unused files
Changed in this revision
utils.cpp | Show diff for this revision Revisions of this file |
utils.h | Show diff for this revision Revisions of this file |
diff -r 5acd27cb1857 -r 6e0dfe2caf48 utils.cpp --- a/utils.cpp Sun Oct 23 19:35:14 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -#include "utils.h" - -/***************************************************************************** -* name: crc16_ansi - -* parameters: - message length in byte -* - pointer to message start -* - crc preload value (start value = 0xFFFF, for the jacksum CRC16 implementation start=0) -* return: - crc value -* description: calculates the CRC16 ANSI checksum of a buffer. -* Implemented as a reverse calculation (Bitorder). So 0xA001 used as -* polynom which is the reversed 0x8005 ANSI polynom, g(x) = x^15 + x^2 + 1 -*****************************************************************************/ -uint16_t crc16_ansi_rev(uint32_t pa_nLen, const uint8_t* pa_pnData, uint16_t pa_nStart) -{ - #define CRC16_ANSI_REVERSED_POL 0xA001 - - uint8_t i; - uint32_t k; - - for(k=0; k<pa_nLen; k++) { - pa_nStart ^= pa_pnData[k]; - for (i = 0; i < 8; ++i) { - if (pa_nStart & 1) { - pa_nStart = (pa_nStart >> 1) ^ CRC16_ANSI_REVERSED_POL; - } else { - pa_nStart = (pa_nStart >> 1); - } - } - } - return pa_nStart; -} \ No newline at end of file
diff -r 5acd27cb1857 -r 6e0dfe2caf48 utils.h --- a/utils.h Sun Oct 23 19:35:14 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -#ifndef UTILS_H -#define UTILS_H - -#include "mbed.h" -uint16_t crc16_ansi_rev(uint32_t pa_nLen, const uint8_t* pa_pnData, uint16_t pa_nStart); - -#endif \ No newline at end of file