From c36abb54ad5ef9f145d98017d43fc7bf6ef344c6 Mon Sep 17 00:00:00 2001 From: jfrey Date: Tue, 4 Apr 2017 11:27:30 +0200 Subject: [PATCH] fix 24bits to 32bits conversion, fix #37 --- open_bci_ganglion.py | 2 +- open_bci_v3.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/open_bci_ganglion.py b/open_bci_ganglion.py index 70492e7..a76b92b 100644 --- a/open_bci_ganglion.py +++ b/open_bci_ganglion.py @@ -614,7 +614,7 @@ def conv24bitsToInt(unpacked): literal_read = struct.pack('3B', unpacked[0], unpacked[1], unpacked[2]) #3byte int in 2s compliment - if (unpacked[0] >= 127): + if (unpacked[0] > 127): pre_fix = bytes(bytearray.fromhex('FF')) else: pre_fix = bytes(bytearray.fromhex('00')) diff --git a/open_bci_v3.py b/open_bci_v3.py index 0581c05..013cb58 100644 --- a/open_bci_v3.py +++ b/open_bci_v3.py @@ -244,7 +244,7 @@ def read(n): log_bytes_in = log_bytes_in + '|' + str(literal_read); #3byte int in 2s compliment - if (unpacked[0] >= 127): + if (unpacked[0] > 127): pre_fix = bytes(bytearray.fromhex('FF')) else: pre_fix = bytes(bytearray.fromhex('00'))