reflow of doc string

This commit is contained in:
Markus Rosenstihl 2019-09-10 14:37:21 +02:00
parent 21e0ffeae5
commit bd5320d468

View File

@ -38,19 +38,21 @@ def crc(message):
after all the characters of the message have been applied, is the CRC value. after all the characters of the message have been applied, is the CRC value.
A procedure for generating a CRC is: A procedure for generating a CRC is:
1. Load a 16bit register with FFFF hex (all 1s). Call this the CRC register. 1. Load a 16bit register with FFFF hex (all 1s). Call this the CRC register.
2. Exclusive OR the first 8bit byte of the message with the loworder byte of the 16bit CRC register, putting the result in the 2. Exclusive OR the first 8bit byte of the message with the loworder byte of the 16bit CRC register, putting the result in the
CRC register. CRC register.
3. Shift the CRC register one bit to the right (toward the LSB), zerofilling the MSB. Extract and examine the LSB. 3. Shift the CRC register one bit to the right (toward the LSB), zerofilling the MSB. Extract and examine the LSB.
4. (If the LSB was 0): Repeat Step 3 (another shift). 4. (If the LSB was 0): Repeat Step 3 (another shift).
(If the LSB was 1): Exclusive OR the CRC register with the polynomial value 0xA001 (1010 0000 0000 0001). (If the LSB was 1): Exclusive OR the CRC register with the polynomial value 0xA001 (1010 0000 0000 0001).
5. Repeat Steps 3 and 4 until 8 shifts have been performed. When this is done, a complete 8bit byte will have been 5. Repeat Steps 3 and 4 until 8 shifts have been performed. When this is done, a complete 8bit byte will have been
processed. processed.
6. Repeat Steps 2 through 5 for the next 8bit byte of the message. Continue doing this until all bytes have been processed. 6. Repeat Steps 2 through 5 for the next 8bit byte of the message. Continue doing this until all bytes have been processed.
7. The final content of the CRC register is the CRC value. 7. The final content of the CRC register is the CRC value.
8. When the CRC is placed into the message, its upper and lower bytes must be swapped as described below. 8. When the CRC is placed into the message, its upper and lower bytes must
be swapped as described below.
Placing the CRC into the Message Placing the CRC into the Message:
=================================
When the 16bit CRC (two 8bit bytes) is transmitted in the message, the low-order byte will be transmitted first, followed by the high- When the 16bit CRC (two 8bit bytes) is transmitted in the message, the low-order byte will be transmitted first, followed by the high-
order byte. order byte.
""" """