Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 16bit MODBUS config #83

Closed
corby opened this issue Apr 5, 2023 · 2 comments · Fixed by #84
Closed

Add 16bit MODBUS config #83

corby opened this issue Apr 5, 2023 · 2 comments · Fixed by #84
Assignees

Comments

@corby
Copy link

corby commented Apr 5, 2023

diff --git a/crc.py b/crc.py
index 3a92bde..ad728fa 100644
--- a/crc.py
+++ b/crc.py
@@ -492,6 +492,15 @@ class Crc16(enum.Enum):
         reverse_output=False,
     )

+    MODBUS = Configuration(
+        width=16,
+        polynomial=0x8005,
+        init_value=0xFFFF,
+        final_xor_value=0x0000,
+        reverse_input=True,
+        reverse_output=True,
+    )
+
@Nicoretti Nicoretti self-assigned this Apr 8, 2023
@Nicoretti
Copy link
Owner

Hi @corby,

thanks for creating an issue, I'll try to get to it next week.

best
Nico.

@Nicoretti
Copy link
Owner

Hi @corby,

the latest version 4.2.0 contains the requested MODBUS configuration.

best
Nico

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants