修改驱采表状态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] 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