FastLED 3.9.7
|
Utility functions and classes for managing delay cycles.
Definition in file fastled_delay.h.
Go to the source code of this file.
Classes | |
class | CMinWait< WAIT > |
Class to ensure that a minimum amount of time has kicked since the last time run - and delay if not enough time has passed yet. More... | |
Macros | |
Some timing related macros/definitions | |
#define | F_CPU_MHZ (F_CPU / 1000000L) |
CPU speed, in megahertz (MHz) | |
#define | NS(_NS) (((_NS * F_CPU_MHZ) + 999) / 1000) |
Convert from nanoseconds to number of clock cycles. | |
#define | CLKS_TO_MICROS(_CLKS) ((long)(_CLKS)) / (F_CPU / 1000000L) |
Convert from number of clock cycles to microseconds. | |
#define | NO_TIME(A, B, C) (NS(A) < 3 || NS(B) < 3 || NS(C) < 6) |
Macro for making sure there's enough time available. | |
Clock cycle counted delay loop | |
#define | FL_NOP __asm__ __volatile__ ("nop\n"); |
Single no operation ("no-op") instruction for delay. | |
#define | FL_NOP2 __asm__ __volatile__ ("nop\n\t nop\n"); |
Double no operation ("no-op") instruction for delay. | |
template<fl::cycle_t CYCLES> | |
void | delaycycles () |
Delay N clock cycles. | |
template<fl::cycle_t CYCLES> | |
void | delaycycles_min1 () |
A variant of delaycycles that will always delay at least one cycle. | |
template<fl::cycle_t CYCLES> | |
FASTLED_FORCE_INLINE void | delaycycles () |
Delay N clock cycles. | |
#define CLKS_TO_MICROS | ( | _CLKS | ) | ((long)(_CLKS)) / (F_CPU / 1000000L) |
Convert from number of clock cycles to microseconds.
Definition at line 209 of file fastled_delay.h.
#define F_CPU_MHZ (F_CPU / 1000000L) |
CPU speed, in megahertz (MHz)
Definition at line 202 of file fastled_delay.h.
#define FL_NOP __asm__ __volatile__ ("nop\n"); |
Single no operation ("no-op") instruction for delay.
Definition at line 70 of file fastled_delay.h.
#define FL_NOP2 __asm__ __volatile__ ("nop\n\t nop\n"); |
Double no operation ("no-op") instruction for delay.
Definition at line 72 of file fastled_delay.h.
Macro for making sure there's enough time available.
Definition at line 212 of file fastled_delay.h.
#define NS | ( | _NS | ) | (((_NS * F_CPU_MHZ) + 999) / 1000) |
Convert from nanoseconds to number of clock cycles.
Definition at line 207 of file fastled_delay.h.
|
inline |
Delay N clock cycles.
CYCLES | the number of clock cycles to delay |
Definition at line 134 of file fastled_delay.h.
|
inline |
Delay N clock cycles.
CYCLES | the number of clock cycles to delay |
Definition at line 134 of file fastled_delay.h.
|
inline |
A variant of delaycycles that will always delay at least one cycle.
Definition at line 85 of file fastled_delay.h.