修改驱采表状态bit编码逻辑

This commit is contained in:
thesai 2024-01-29 17:35:46 +08:00
parent 2cc7564772
commit b54224351f

View File

@ -28,9 +28,9 @@ func SetBitOfBytes(bs []byte, bitIndex int, v bool) []byte {
}
by := bs[bi]
if v {
by |= (1 << (7 - i))
by |= (1 << i)
} else {
by &= ((1 << (7 - i)) ^ byte(0xff))
by &= ((1 << i) ^ byte(0xff))
}
bs[bi] = by
return bs