Skip to content

Commit 0d3d4e3

Browse files
committed
Update connection
1 parent 1579412 commit 0d3d4e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/Connection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1273,6 +1273,7 @@ const Connection: React.FC<ConnectionProps> = ({
12731273
setSelectedChannels(selectedChannels)
12741274

12751275
}, [selectedChannels]);
1276+
const prevSampleCounterRef = useRef<number | null>(null); // Variable to store the previous counter value for loss detection
12761277

12771278
// Function to read data from a connected device and process it
12781279
const readData = async (): Promise<void> => {
@@ -1282,7 +1283,6 @@ const Connection: React.FC<ConnectionProps> = ({
12821283
const SYNC_BYTE1 = 0xc7; // First synchronization byte to identify the start of a packet
12831284
const SYNC_BYTE2 = 0x7c; // Second synchronization byte
12841285
const END_BYTE = 0x01; // End byte to signify the end of a packet
1285-
const prevSampleCounterRef = useRef<number | null>(null); // Variable to store the previous counter value for loss detection
12861286
const notchFilters = Array.from({ length: maxCanvasElementCountRef.current }, () => new Notch());
12871287
const EXGFilters = Array.from({ length: maxCanvasElementCountRef.current }, () => new EXGFilter());
12881288
const pointoneFilter = Array.from({ length: maxCanvasElementCountRef.current }, () => new HighPassFilter());

0 commit comments

Comments
 (0)