fix 24bits to 32bits conversion, fix #37

Esse commit está contido em:
jfrey
2017-04-04 11:27:30 +02:00
commit c36abb54ad
2 arquivos alterados com 2 adições e 2 exclusões
+1 -1
Ver Arquivo
@@ -614,7 +614,7 @@ def conv24bitsToInt(unpacked):
literal_read = struct.pack('3B', unpacked[0], unpacked[1], unpacked[2]) literal_read = struct.pack('3B', unpacked[0], unpacked[1], unpacked[2])
#3byte int in 2s compliment #3byte int in 2s compliment
if (unpacked[0] >= 127): if (unpacked[0] > 127):
pre_fix = bytes(bytearray.fromhex('FF')) pre_fix = bytes(bytearray.fromhex('FF'))
else: else:
pre_fix = bytes(bytearray.fromhex('00')) pre_fix = bytes(bytearray.fromhex('00'))
+1 -1
Ver Arquivo
@@ -244,7 +244,7 @@ class OpenBCIBoard(object):
log_bytes_in = log_bytes_in + '|' + str(literal_read); log_bytes_in = log_bytes_in + '|' + str(literal_read);
#3byte int in 2s compliment #3byte int in 2s compliment
if (unpacked[0] >= 127): if (unpacked[0] > 127):
pre_fix = bytes(bytearray.fromhex('FF')) pre_fix = bytes(bytearray.fromhex('FF'))
else: else:
pre_fix = bytes(bytearray.fromhex('00')) pre_fix = bytes(bytearray.fromhex('00'))