X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=firmware%2Fcontrol.c;h=c351ca80b0fef5a386ce493a866dc65c98a0bb70;hb=245a5fcfa3da6628a5634a9899913c0be143ffa9;hp=3012ba65856aaa02d9e2939ace37ed2463863da0;hpb=94524330d5709845fe0bbe8562fd68deedcb818c;p=bike-lights.git diff --git a/firmware/control.c b/firmware/control.c index 3012ba6..c351ca8 100644 --- a/firmware/control.c +++ b/firmware/control.c @@ -50,12 +50,12 @@ static pattern_t fast_pattern[] = { }; static pattern_t night_pattern[] = { - { PWM_PAT(2, 0, 2), D_3 }, - { PWM_PAT(3, 0, 0), D_8 }, - { PWM_PAT(2, 0, 2), D_1 }, - { PWM_PAT(3, 0, 0), D_2 }, - { PWM_PAT(2, 0, 2), D_1 }, - { PWM_PAT(3, 0, 0), D_8 }, + { PWM_PAT(3, 0, 1), D_3 }, + { PWM_PAT(2, 0, 0), D_8 }, + { PWM_PAT(3, 0, 1), D_1 }, + { PWM_PAT(2, 0, 0), D_2 }, + { PWM_PAT(3, 0, 1), D_1 }, + { PWM_PAT(2, 0, 0), D_8 }, PATTERN_END }; @@ -148,6 +148,9 @@ pattern_t *status_led_pattern_select() pattern_t *illumination_led_pattern_select() { + if (buttons_setup_in_progress()) + return buttons_setup_status1_pattern_select(); + if (battery_critical) return NULL; @@ -182,7 +185,12 @@ void pwmled_select_brightness() if (battery_critical) { brightness = PWMLED_BRIGHTNESS(0, 0, 0, 0, 0); - } else if (ambient_zone < 2) { + } else if (ambient_zone == 0) { + if (dim_mode) + brightness = PWMLED_BRIGHTNESS(0, 1, 0, 0, 1); + else + brightness = PWMLED_BRIGHTNESS(1, 3, 2, 1, 3); + } else if (ambient_zone == 1) { if (dim_mode) brightness = PWMLED_BRIGHTNESS(0, 1, 0, 0, 1); else