chore: modernize
This commit is contained in:
parent
0eca536c9e
commit
77067ef783
3 changed files with 7 additions and 7 deletions
|
|
@ -224,7 +224,7 @@ func modbusCRC16(data []byte) []byte {
|
|||
crc := uint16(0xFFFF)
|
||||
for _, b := range data {
|
||||
crc ^= uint16(b)
|
||||
for i := 0; i < 8; i++ {
|
||||
for range 8 {
|
||||
if crc&0x0001 != 0 {
|
||||
crc = (crc >> 1) ^ 0xA001
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue