]> www.fi.muni.cz Git - bike-lights.git/blobdiff - firmware/lights.h
Common patterns rewrite
[bike-lights.git] / firmware / lights.h
index a3dbb636c61ac88c8d5be2c161963f4825091b6d..26f7372988d00bff323654f41adea2459581b59f 100644 (file)
@@ -61,6 +61,14 @@ void susp_tmr();
 void init_pwmled();
 void pwmled_adc(unsigned char n, uint16_t adcval);
 void pwmled_set_mode(unsigned char n, unsigned char mode);
+void pwmled_set_brightness(uint16_t brightness);
+#define PWMLED_BRIGHTNESS(l0_lo, l0_hi, l1, l2_lo, l2_hi) ( \
+          (uint16_t)(l0_lo) \
+       | ((uint16_t)(l0_hi) << 3) \
+       | ((uint16_t)(l1)    << 6) \
+       | ((uint16_t)(l2_lo) << 9) \
+       | ((uint16_t)(l2_hi) << 12) \
+       )
 
 /* gpio.c */
 void init_gpio();
@@ -120,7 +128,7 @@ void init_battery();
 unsigned char battery_gauge();
 
 /* control.c */
-extern pattern_t on1_pattern[];
+extern pattern_t on_pattern[];
 
 void init_control();
 void brake_on();