Skip to content

Commit

Permalink
Merge pull request #460 from klutvott123/min-check
Browse files Browse the repository at this point in the history
Check for min attribute
  • Loading branch information
haslinghuis committed Nov 14, 2022
2 parents 378ba2f + 0877a7b commit 10954d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/SCRIPTS/BF/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ local function processMspReply(cmd,rx_buf)
f.value = bit32.bor(f.value, raw_val)
end
local bits = #f.vals * 8
if f.min < 0 and bit32.btest(f.value, bit32.lshift(1, bits - 1)) then
if f.min and f.min < 0 and bit32.btest(f.value, bit32.lshift(1, bits - 1)) then
f.value = f.value - (2 ^ bits)
end
f.value = f.value/(f.scale or 1)
Expand Down

0 comments on commit 10954d4

Please sign in to comment.