]> www.fi.muni.cz Git - bike-lights.git/blobdiff - firmware/lights.h
main.c: split up the main() function
[bike-lights.git] / firmware / lights.h
index f31760621f1ab4da18b61f9b41cffdc303f2e050..7e7e2a4d850b18d46e469c8e75668b42f1ca1f32 100644 (file)
 
 /* logging.c */
 #ifdef USE_LOGGING
-void init_log();
+void init_log(unsigned char mcusr);
 void log_set_state(unsigned char val);
 void log_flush();
 void log_byte(unsigned char byte);
 void log_word(uint16_t word);
 #else
-void inline init_log() { }
+void inline init_log(unsigned char mcusr) { }
 void inline log_set_state(unsigned char val) { }
 void inline log_flush() { }
 void inline log_byte(unsigned char byte) { }
@@ -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);
@@ -118,7 +126,7 @@ pattern_t *illumination_led_pattern_select();
 pattern_t *laser_pattern_select();
 
 /* main.c */
-void power_down();
+void power_down(unsigned char err);
 
 #endif /* !LIGHTS_H__ */