projects
/
hmcfgusb
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9248b98
)
hmuartlgw: simplify crc check
author
Michael Gernoth
<michael@gernoth.net>
Sun, 5 Jun 2016 17:23:32 +0000
(19:23 +0200)
committer
Michael Gernoth
<michael@gernoth.net>
Sun, 5 Jun 2016 17:23:32 +0000
(19:23 +0200)
hmuartlgw.c
patch
|
blob
|
blame
|
history
diff --git
a/hmuartlgw.c
b/hmuartlgw.c
index 2e6757a4720ed68ee34ab9cc4de2f06590b83033..4c274cf93e85ea558c0995684c29363dbc112cb7 100644
(file)
--- a/
hmuartlgw.c
+++ b/
hmuartlgw.c
@@
-413,10
+413,8
@@
int hmuartlgw_poll(struct hmuartlgw_dev *dev, int timeout)
return -1;
}
- crc = crc16(dev->buf, dev->pos - 2);
- if ((((crc >> 8) & 0xff) == dev->buf[dev->pos - 2]) &&
- ((crc & 0xff) == dev->buf[dev->pos - 1])) {
-
+ crc = crc16(dev->buf, dev->pos);
+ if (crc == 0x0000) {
if (debug)
hexdump(dev->buf, dev->pos, "UARTLGW > ");
Impressum
,
Datenschutz