Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FastLED/FastLED.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'clockless.h')
-rw-r--r--clockless.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/clockless.h b/clockless.h
index 6a62a52c..631adc86 100644
--- a/clockless.h
+++ b/clockless.h
@@ -4,6 +4,12 @@
#include "controller.h"
#include <avr/interrupt.h> // for cli/se definitions
+// Macro to convert from nano-seconds to clocks
+#define NS(_NS) (_NS / (1000 / (F_CPU / 1000000L)))
+
+// Macro for making sure there's enough time available
+#define NO_TIME(A, B, C) (NS(A) < 3 || NS(B) < 2 || NS(C) < 6)
+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Base template for clockless controllers. These controllers have 3 control points in their cycle for each bit. The first point