Skip to content

Commit 6000baf

Browse files
committed
util/crc16.h: Update documentation re. inline (avrdudes#990)
1 parent 5125403 commit 6000baf

File tree

1 file changed

+20
-25
lines changed

1 file changed

+20
-25
lines changed

Diff for: include/util/crc16.h

+20-25
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,9 @@
4343
/** \defgroup util_crc <util/crc16.h>: CRC Computations
4444
\code#include <util/crc16.h>\endcode
4545
46-
This header file provides a optimized inline functions for calculating
46+
This header file provides optimized inline functions for calculating
4747
cyclic redundancy checks (CRC) using common polynomials.
4848
49-
\par References:
50-
51-
\par
52-
53-
See the Dallas Semiconductor app note 27 for 8051 assembler example and
54-
general CRC optimization suggestions. The table on the last page of the
55-
app note is the key to understanding these implementations.
56-
57-
\par
58-
59-
Jack Crenshaw's "Implementing CRCs" article in the January 1992 issue of \e
60-
Embedded \e Systems \e Programming. This may be difficult to find, but it
61-
explains CRC's in very clear and concise terms. Well worth the effort to
62-
obtain a copy.
63-
6449
A typical application would look like:
6550
6651
\code
@@ -78,6 +63,16 @@
7863
return crc; // must be 0
7964
}
8065
\endcode
66+
67+
\par References:
68+
See the Dallas Semiconductor app note 27 for 8051 assembler example and
69+
general CRC optimization suggestions. The table on the last page of the
70+
app note is the key to understanding these implementations.
71+
\par
72+
Jack Crenshaw's "Implementing CRCs" article in the January 1992 issue of \e
73+
Embedded \e Systems \e Programming. This may be difficult to find, but it
74+
explains CRC's in very clear and concise terms. Well worth the effort to
75+
obtain a copy.
8176
*/
8277

8378
/** \ingroup util_crc
@@ -91,8 +86,8 @@
9186
The following is the equivalent functionality written in C.
9287
9388
\code
94-
uint16_t
95-
crc16_update (uint16_t crc, uint8_t a)
89+
static inline uint16_t
90+
_crc16_update (uint16_t crc, uint8_t a)
9691
{
9792
crc ^= a;
9893
for (int i = 0; i < 8; ++i)
@@ -155,8 +150,8 @@ _crc16_update(uint16_t __crc, uint8_t __data)
155150
The following is the equivalent functionality written in C.
156151
157152
\code
158-
uint16_t
159-
crc_xmodem_update (uint16_t crc, uint8_t data)
153+
static inline uint16_t
154+
_crc_xmodem_update (uint16_t crc, uint8_t data)
160155
{
161156
crc = crc ^ ((uint16_t)data << 8);
162157
for (int i = 0; i < 8; i++)
@@ -223,8 +218,8 @@ _crc_xmodem_update (uint16_t __crc, uint8_t __data)
223218
The following is the equivalent functionality written in C.
224219
225220
\code
226-
uint16_t
227-
crc_ccitt_update (uint16_t crc, uint8_t data)
221+
static inline uint16_t
222+
_crc_ccitt_update (uint16_t crc, uint8_t data)
228223
{
229224
data ^= lo8 (crc);
230225
data ^= data << 4;
@@ -282,7 +277,7 @@ _crc_ccitt_update (uint16_t __crc, uint8_t __data)
282277
The following is the equivalent functionality written in C.
283278
284279
\code
285-
uint8_t
280+
static inline uint8_t
286281
_crc_ibutton_update (uint8_t crc, uint8_t data)
287282
{
288283
crc = crc ^ data;
@@ -335,12 +330,12 @@ _crc_ibutton_update (uint8_t __crc, uint8_t __data)
335330
Reference: http://www.itu.int/rec/T-REC-I.432.1-199902-I/en
336331
337332
The C equivalent has been originally written by Dave Hylands.
338-
Assembly code is based on _crc_ibutton_update optimization.
333+
Assembly code is based on \c _crc_ibutton_update optimization.
339334
340335
The following is the equivalent functionality written in C.
341336
342337
\code
343-
uint8_t
338+
static inline uint8_t
344339
_crc8_ccitt_update (uint8_t inCrc, uint8_t inData)
345340
{
346341
uint8_t data = inCrc ^ inData;

0 commit comments

Comments
 (0)