We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6309212 commit 7b7d61dCopy full SHA for 7b7d61d
cores/arduino/wiring.c
@@ -78,7 +78,7 @@ unsigned long millis()
78
79
unsigned long micros() {
80
unsigned long m;
81
- uint8_t oldSREG = SREG, t;
+ uint8_t oldSREG = SREG, t, flags;
82
83
cli();
84
m = timer0_overflow_count;
@@ -91,14 +91,15 @@ unsigned long micros() {
91
#endif
92
93
#ifdef TIFR0
94
- if ((TIFR0 & _BV(TOV0)) && (t < 255))
95
- m++;
+ flags = TIFR0;
96
#else
97
- if ((TIFR & _BV(TOV0)) && (t < 255))
98
+ flags = TIFR;
99
100
101
SREG = oldSREG;
+
+ if ((flags & _BV(TOV0)) && (t < 255))
102
+ m++;
103
104
return ((m << 8) + t) * (64 / clockCyclesPerMicrosecond());
105
}
0 commit comments