// flags, data hold pointers to memory-mapped device register while (*flags & TXFF_MASK); *data = c;
for (;;) { if( c1 ) a1; if( c2 ) a2; ... }⇒worst-case latency: sum of all actions
for (;;) { if( c1 ) a1; if( c2 ) a2; if( c1 ) a1; if( c3 ) a3; ... }⇒worst-case latency: maximum of all actions
for (;;) { if( c1 ) a1; if( c2 ) { a2.1; a2half = true; } if( c1 ) a1; if( a2half ) { a2.2; a2half = false; } ... }