Skip to content

Commit 9d712fa

Browse files
committed
Remove extra print statements and exit()
1 parent c4c75c8 commit 9d712fa

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

bioamptool.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,14 @@ def read_arduino_data(ser, csv_writer):
8888

8989
if(len(buffer) >= sync_index + PACKET_LENGTH):
9090
packet = buffer[sync_index:sync_index+PACKET_LENGTH]
91-
print(packet)
9291
if len(packet) == 17 and packet[0] == SYNC_BYTE1 and packet[1] == SYNC_BYTE2 and packet[-1] == END_BYTE:
9392
counter = packet[3] # Counter is at index 3
9493

9594
# Ensure counter number is exactly one more than the previous one
9695
if previous_sample_number is not None and counter != (previous_sample_number + 1) % 256:
9796
missing_samples += (counter - previous_sample_number - 1) % 256
9897
print(f"Error: Expected counter {previous_sample_number + 1} but received {counter}. Missing samples: {missing_samples}")
99-
exit()
100-
98+
10199
previous_sample_number = counter # Update previous sample number to current counter
102100

103101
total_packet_count += 1 # Increment packet count only after initial samples are ignored
@@ -119,7 +117,6 @@ def read_arduino_data(ser, csv_writer):
119117
del buffer[:sync_index + PACKET_LENGTH]
120118
else:
121119
del buffer[:sync_index + 1]
122-
print("Invalid Data Packet") # Print message if data packet is invalid
123120

124121
def start_timer():
125122
"""

0 commit comments

Comments
 (0)