MCPcopy Create free account
hub / github.com/FastLED/FastLED / micros

Function micros

src/wiring.cpp.hpp:60–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60unsigned long micros() {
61 unsigned long m;
62 fl::u8 oldSREG = SREG, t;
63
64 cli();
65 m = FastLED_timer0_overflow_count; // ._long;
66#if defined(TCNT0)
67 t = TCNT0;
68#elif defined(TCNT0L)
69 t = TCNT0L;
70#else
71 #error TIMER 0 not defined
72#endif
73
74
75#ifdef TIFR0
76 if ((TIFR0 & _BV(TOV0)) && (t < 255))
77 ++m;
78#else
79 if ((TIFR & _BV(TOV0)) && (t < 255))
80 ++m;
81#endif
82
83 SREG = oldSREG;
84
85 return ((m << 8) + t) * (64 / clockCyclesPerMicrosecond());
86}
87
88void delay(unsigned long ms)
89{

Callers 15

showMethod · 0.70
showColorMethod · 0.70
waitMethod · 0.70
markMethod · 0.70
delayFunction · 0.70
benchFunction · 0.50
mainFunction · 0.50
mainFunction · 0.50
mainFunction · 0.50
mainFunction · 0.50
runProfilerFunction · 0.50
runProfilerFunction · 0.50

Calls 1

cliFunction · 0.50

Tested by

no test coverage detected