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.
Comment #1
Posted on Aug 15, 2009 by Happy Rhino(No comment was entered for this change.)
Comment #2
Posted on Dec 18, 2009 by Happy Rhino(No comment was entered for this change.)
Status: Fixed
Labels:
Type-Enhancement
Priority-Medium
Component-Core
Milestone-0018