修改驱采表状态bit编码逻辑
This commit is contained in:
parent
2cc7564772
commit
b54224351f
@ -28,9 +28,9 @@ func SetBitOfBytes(bs []byte, bitIndex int, v bool) []byte {
|
|||||||
}
|
}
|
||||||
by := bs[bi]
|
by := bs[bi]
|
||||||
if v {
|
if v {
|
||||||
by |= (1 << (7 - i))
|
by |= (1 << i)
|
||||||
} else {
|
} else {
|
||||||
by &= ((1 << (7 - i)) ^ byte(0xff))
|
by &= ((1 << i) ^ byte(0xff))
|
||||||
}
|
}
|
||||||
bs[bi] = by
|
bs[bi] = by
|
||||||
return bs
|
return bs
|
||||||
|
Loading…
Reference in New Issue
Block a user