]> www.fi.muni.cz Git - bike-lights.git/blobdiff - firmware/control.c
5th brightness 2500 mA
[bike-lights.git] / firmware / control.c
index a0d2451a5df08cd0b095c7438b05bc714bd613c3..73f5e8ee02ee5ce7ce9ad5da593274dbdbc7f6b6 100644 (file)
@@ -140,6 +140,9 @@ pattern_t *pwmled_pattern_select()
        if (err_flags.err_battery)
                return slow_pattern;
 
+       if (ambient_shadow)
+               return night_pattern;
+
        switch (ambient_zone) {
        case 0: return night_pattern;
        case 1:
@@ -185,6 +188,9 @@ pattern_t *illumination_led_pattern_select()
        if (err_flags.err_battery)
                return NULL;
 
+       if (ambient_shadow)
+               return on_pattern;
+
        switch (ambient_zone) {
        case 0: return dim_mode
                ? number_pattern(1, 1)
@@ -218,9 +224,9 @@ void pwmled_select_brightness()
                brightness = PWMLED_BRIGHTNESS(0, 0, 0, 0, 0);
        } else if (ambient_zone == 0) {
                if (dim_mode)
-                       brightness = PWMLED_BRIGHTNESS(0, 1, 0, 0, 1);
+                       brightness = PWMLED_BRIGHTNESS(0, 1, 0, 0, 2);
                else
-                       brightness = PWMLED_BRIGHTNESS(1, 3, 2, 1, 3);
+                       brightness = PWMLED_BRIGHTNESS(1, 3, 2, 1, 4);
        } else if (ambient_zone == 1) {
                if (dim_mode)
                        brightness = PWMLED_BRIGHTNESS(0, 1, 0, 0, 1);
@@ -229,7 +235,7 @@ void pwmled_select_brightness()
        } else if (ambient_zone == 2) {
                brightness = PWMLED_BRIGHTNESS(1, 3, 2, 1, 3);
        } else if (ambient_zone == 3) {
-               brightness = PWMLED_BRIGHTNESS(2, 4, 2, 2, 4);
+               brightness = PWMLED_BRIGHTNESS(2, 4, 2, 2, 5);
        }
 
        pwmled_set_brightness(brightness);