]> www.fi.muni.cz Git - bike-lights.git/blobdiff - firmware/lights.h
patterns: fibonacci-scaled step duration
[bike-lights.git] / firmware / lights.h
index f31760621f1ab4da18b61f9b41cffdc303f2e050..5d1b6e5ae61b43f6b03238e6c071347a0e087ade 100644 (file)
@@ -74,10 +74,18 @@ void ambient_adc(uint16_t adc_val);
 /* pattern.c */
 typedef struct {
        unsigned char mode: 5;
-       unsigned char duration: 3;
+       unsigned char duration_fib: 3;
 } pattern_t;
 
 #define PATTERN_END { 0, 0 }
+#define D_1 1
+#define D_2 2
+#define D_3 3
+#define D_5 4
+#define D_8 5
+#define D_13 6
+#define D_21 7
+
 void init_pattern();
 void patterns_next_tick();
 void led_set_pattern(unsigned char led, pattern_t *pattern);