wacom: use int.from_bytes to convert from signed char to int
This commit is contained in:
parent
1527fae191
commit
5336f02df1
|
@ -47,9 +47,7 @@ SMARTPAD_UUID = '4810d75d5d4d'
|
|||
|
||||
|
||||
def signed_char_to_int(v):
|
||||
if v & 0x80:
|
||||
return v - (1 << 8)
|
||||
return v
|
||||
return int.from_bytes([v], byteorder='little', signed=True)
|
||||
|
||||
|
||||
def b2hex(bs):
|
||||
|
|
Loading…
Reference in New Issue