there are 1024 microseconds per overflow counter tick.
| 44 | |
| 45 | // there are 1024 microseconds per overflow counter tick. |
| 46 | unsigned long millis() |
| 47 | { |
| 48 | unsigned long m; |
| 49 | fl::u8 oldSREG = SREG; |
| 50 | |
| 51 | // disable interrupts while we read FastLED_timer0_millis or we might get an |
| 52 | // inconsistent value (e.g. in the middle of a write to FastLED_timer0_millis) |
| 53 | cli(); |
| 54 | m = FastLED_timer0_overflow_count; //._long; |
| 55 | SREG = oldSREG; |
| 56 | |
| 57 | return (m*(MICROSECONDS_PER_TIMER0_OVERFLOW/8))/(1000/8); |
| 58 | } |
| 59 | |
| 60 | unsigned long micros() { |
| 61 | unsigned long m; |