We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8339f2c commit 24c10daCopy full SHA for 24c10da
open_bci_ganglion.py
@@ -453,10 +453,12 @@ def conv19bitToInt32 (threeByteBuffer):
453
454
prefix = 0;
455
456
+ # if LSB is 1, negative number, some hasty unsigned to signed conversion to do
457
if threeByteBuffer[2] & 0x01 > 0:
458
prefix = 0b1111111111111;
-
459
- return (prefix << 19) | (threeByteBuffer[0] << 16) | (threeByteBuffer[1] << 8) | threeByteBuffer[2]
+ return ((prefix << 19) | (threeByteBuffer[0] << 16) | (threeByteBuffer[1] << 8) | threeByteBuffer[2]) | ~0xFFFFFFFF
460
+ else:
461
+ return (prefix << 19) | (threeByteBuffer[0] << 16) | (threeByteBuffer[1] << 8) | threeByteBuffer[2]
462
463
def decompressDeltas19Bit(buffer):
464
"""
0 commit comments