]> 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 72b719b321eaff5907a604ef2c0f2b7d528cf013..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) { }
@@ -29,6 +29,7 @@ void inline log_word(uint16_t word) { }
 void init_adc();
 void susp_adc();
 void timer_start_slow_adcs();
+extern volatile unsigned char adc_is_on;
 
 /* pwm.c */
 /*
@@ -72,11 +73,19 @@ void ambient_adc(uint16_t adc_val);
 
 /* pattern.c */
 typedef struct {
-       unsigned char mode: 3;
-       unsigned char duration: 5;
+       unsigned char mode: 5;
+       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);
@@ -117,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__ */