Skip to content

Commit f899032

Browse files
authored
Add comments to explain timeout functionality
The timeout functionality has changed, and it needs to be explained. Timeouts because of lost sync bytes should be done on the opposite end if needed. Otherwise, the two sides get out of sync every now and then.
1 parent 3be7107 commit f899032

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libraries/Camera/examples/CameraCaptureRawBytes/CameraCaptureRawBytes.ino

+3-1
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,12 @@ void loop() {
6464
while(!Serial);
6565
}
6666

67-
// Time out after 2 seconds and send new data
67+
// Time out after 2 seconds, which sets the (constant) frame rate
6868
bool timeoutDetected = millis() - lastUpdate > 2000;
6969

7070
// Wait for sync byte and timeout
71+
// Notice that this order must be kept, or the sync bytes will be
72+
// consumed prematurely
7173
if ((!timeoutDetected) || (Serial.read() != 1))
7274
{
7375
return;

0 commit comments

Comments
 (0)