What change would like to see?
The delayMicroseconds() function should not disable interrupts. If
precise timing is needed, the user should disable microseconds outside of
the call to delayMicrosconds().
Why?
Having the disabling of interrupts inside the function limits the
flexibility of the function. It would be good to be able to leave
interrupts enabled if desired. For example, the LiquidCrystal library has
lots of calls to delayMicroseconds(), but doesn't need very precise
timings. It would be better not to disable interrupts here, because it
can interfere with millis(), etc.
Further, as BenF points out on the forum, disabling interrupts doesn't
help anyway, because interrupts can be called after SREG is restored and
before delayMicroseconds() returns: http://www.arduino.cc/cgi-
bin/yabb2/YaBB.pl?num=1248706486
Would this cause any incompatibilities with previous versions? If so, how
can these be mitigated?
Not really, since the interrupts can still be triggered, causing delays.
Original issue reported on code.google.com by dmel...@gmail.com on 31 Jul 2009 at 10:41
Original issue reported on code.google.com by
dmel...@gmail.com
on 31 Jul 2009 at 10:41