Skip to content

Commit

Permalink
Merge pull request #467 from kdijkstra/bug3307
Browse files Browse the repository at this point in the history
bugfix for bug3307
  • Loading branch information
robertoostenveld committed Jun 27, 2017
2 parents c314aa7 + 0579cb8 commit 22b1132
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions fileio/private/read_trigger.m
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@
end

if fixbiosemi
if ft_platform_supports('int32_logical_operations')
% convert to 32-bit integer representation and only preserve the lowest 24 bits
dat = bitand(int32(dat), 2^24-1);
% apparently the 24 bits are still shifted by one byte
dat = bitshift(dat,-8);
else
% find indices of negative numbers
signbit = find(dat < 0);
% change type to double (otherwise bitcmp will fail)
Expand All @@ -101,6 +107,7 @@
dat(signbit) = dat(signbit)+(2^(24-1));
% typecast the data to ensure that the status channel is represented in 32 bits
dat = uint32(dat);
end

byte1 = 2^8 - 1;
byte2 = 2^16 - 1 - byte1;
Expand Down

0 comments on commit 22b1132

Please sign in to comment.