Update B6-temp.md

This commit is contained in:
rusefillc 2022-08-30 04:14:35 -04:00 committed by GitHub
parent c30d6fc62e
commit d5eb58b64e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

@ -8,6 +8,18 @@ MOTOR_6 = 0x488
MOTOR_7 = 0x588
xorChecksum(data, targetIndex)
local index = 1
local result = 0
while data[index] ~= nil do
if index ~= targetIndex then
result = result ~ data[index]
end
index = index + 1
end
return result
end
function getBitRange(data, bitIndex, bitWidth)
byteIndex = bitIndex >> 3
shift = bitIndex - byteIndex * 8