Skip to content

Commit 62395e4

Browse files
author
Kevin Moloney
committed
Fix Klocwork#1093: Infinite loop.
* Added comment to verify requirement for infinite loop. Signed-off-by: Kevin Moloney <[email protected]>
1 parent b3afd60 commit 62395e4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cores/arduino/CDCSerialClass.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ int CDCSerialClass::read( void )
120120

121121
void CDCSerialClass::flush( void )
122122
{
123-
while (_tx_buffer->tail != _tx_buffer->head) {
123+
while (_tx_buffer->tail != _tx_buffer->head) { /* This infinite loop is intentional
124+
and requested by design */
124125
delayMicroseconds(1);
125126
}
126127
}

0 commit comments

Comments
 (0)