]> www.fi.muni.cz Git - bike-lights.git/commitdiff
pwmled.c: start probing with non-zero PWM value
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Mon, 3 Jun 2013 20:04:33 +0000 (22:04 +0200)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Mon, 3 Jun 2013 20:04:48 +0000 (22:04 +0200)
... in order to kick the ADCs on.

firmware/pwmled.c

index 9aa6d8074689dd9b5e08de41e2d0a23e805e4a60..db1cb862c75f21043acb8d34e668ff4037e63429 100644 (file)
@@ -94,10 +94,11 @@ void init_pwmled()
                pwmled_t *led = pwmleds + i;
                led->err_sum = 0;
                led->target = adc_vals[i*N_PWMLED_MODES];
-               led->pwm = 0;
                led->mode = 1;
-               led->state = ST_PROBING;
                led->probe_steady = 0;
+               led->state = ST_PROBING;
+               led->pwm = 1;
+               pwm_set(i, led->pwm);
 
                for (j = 0; j < N_PWMLED_MODES; j++) {
                        led->mode_pwm[j] = 0;