1 |
10 |
wfjm |
// $Id: RlinkCrc8.cpp 365 2011-02-28 07:28:26Z mueller $
|
2 |
|
|
//
|
3 |
|
|
// Copyright 2011- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
4 |
|
|
//
|
5 |
|
|
// This program is free software; you may redistribute and/or modify it under
|
6 |
|
|
// the terms of the GNU General Public License as published by the Free
|
7 |
|
|
// Software Foundation, either version 2, or at your option any later version.
|
8 |
|
|
//
|
9 |
|
|
// This program is distributed in the hope that it will be useful, but
|
10 |
|
|
// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
|
11 |
|
|
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
12 |
|
|
// for complete details.
|
13 |
|
|
//
|
14 |
|
|
// Revision History:
|
15 |
|
|
// Date Rev Version Comment
|
16 |
|
|
// 2011-02-27 365 1.0 Initial version
|
17 |
|
|
// 2011-01-15 355 0.1 First draft
|
18 |
|
|
// ---------------------------------------------------------------------------
|
19 |
|
|
|
20 |
|
|
/*!
|
21 |
|
|
\file
|
22 |
|
|
\version $Id: RlinkCrc8.cpp 365 2011-02-28 07:28:26Z mueller $
|
23 |
|
|
\brief Implemenation of class RlinkCrc8.
|
24 |
|
|
*/
|
25 |
|
|
|
26 |
|
|
#include "RlinkCrc8.hpp"
|
27 |
|
|
|
28 |
|
|
using namespace std;
|
29 |
|
|
using namespace Retro;
|
30 |
|
|
|
31 |
|
|
/*!
|
32 |
|
|
\class Retro::RlinkCrc8
|
33 |
|
|
\brief FIXME_text
|
34 |
|
|
*/
|
35 |
|
|
|
36 |
|
|
//------------------------------------------+-----------------------------------
|
37 |
|
|
//! FIXME_docs
|
38 |
|
|
// from gen_crc8_tbl
|
39 |
|
|
|
40 |
|
|
const uint8_t RlinkCrc8::fCrc8Table[256] =
|
41 |
|
|
{
|
42 |
|
|
0, 29, 58, 39, 116, 105, 78, 83,
|
43 |
|
|
232, 245, 210, 207, 156, 129, 166, 187,
|
44 |
|
|
205, 208, 247, 234, 185, 164, 131, 158,
|
45 |
|
|
37, 56, 31, 2, 81, 76, 107, 118,
|
46 |
|
|
135, 154, 189, 160, 243, 238, 201, 212,
|
47 |
|
|
111, 114, 85, 72, 27, 6, 33, 60,
|
48 |
|
|
74, 87, 112, 109, 62, 35, 4, 25,
|
49 |
|
|
162, 191, 152, 133, 214, 203, 236, 241,
|
50 |
|
|
19, 14, 41, 52, 103, 122, 93, 64,
|
51 |
|
|
251, 230, 193, 220, 143, 146, 181, 168,
|
52 |
|
|
222, 195, 228, 249, 170, 183, 144, 141,
|
53 |
|
|
54, 43, 12, 17, 66, 95, 120, 101,
|
54 |
|
|
148, 137, 174, 179, 224, 253, 218, 199,
|
55 |
|
|
124, 97, 70, 91, 8, 21, 50, 47,
|
56 |
|
|
89, 68, 99, 126, 45, 48, 23, 10,
|
57 |
|
|
177, 172, 139, 150, 197, 216, 255, 226,
|
58 |
|
|
38, 59, 28, 1, 82, 79, 104, 117,
|
59 |
|
|
206, 211, 244, 233, 186, 167, 128, 157,
|
60 |
|
|
235, 246, 209, 204, 159, 130, 165, 184,
|
61 |
|
|
3, 30, 57, 36, 119, 106, 77, 80,
|
62 |
|
|
161, 188, 155, 134, 213, 200, 239, 242,
|
63 |
|
|
73, 84, 115, 110, 61, 32, 7, 26,
|
64 |
|
|
108, 113, 86, 75, 24, 5, 34, 63,
|
65 |
|
|
132, 153, 190, 163, 240, 237, 202, 215,
|
66 |
|
|
53, 40, 15, 18, 65, 92, 123, 102,
|
67 |
|
|
221, 192, 231, 250, 169, 180, 147, 142,
|
68 |
|
|
248, 229, 194, 223, 140, 145, 182, 171,
|
69 |
|
|
16, 13, 42, 55, 100, 121, 94, 67,
|
70 |
|
|
178, 175, 136, 149, 198, 219, 252, 225,
|
71 |
|
|
90, 71, 96, 125, 46, 51, 20, 9,
|
72 |
|
|
127, 98, 69, 88, 11, 22, 49, 44,
|
73 |
|
|
151, 138, 173, 176, 227, 254, 217, 196
|
74 |
|
|
};
|
75 |
|
|
|
76 |
|
|
//------------------------------------------+-----------------------------------
|
77 |
|
|
#if (defined(Retro_NoInline) || defined(Retro_RlinkCrc8_NoInline))
|
78 |
|
|
#define inline
|
79 |
|
|
#include "RlinkCrc8.ipp"
|
80 |
|
|
#undef inline
|
81 |
|
|
#endif
|