static uint16_t pwm_vals[N_PWMLEDS*N_PWMLED_MODES];
static uint16_t pwm_max[N_PWMLEDS] = {
- PWM_MAX/2,
+ 2*PWM_MAX/3,
PWM_MAX - (PWM_MAX >> 4), // step-up
- PWM_MAX/2
+ 2*PWM_MAX/3
};
#define PWMLED2_TESTING_WITH_350MA_LED
#endif
if (adcval > adc_max[n] // Too high
- || (pwm == 0 && adcval > 0) // non-zero voltage with zero PWM
+ || (pwm == 0 && adcval > 2) // non-zero voltage with zero PWM
) {
pwm_off(n);
pwmled_state[n] = ST_DISABLED;
if (new_pwm > (int16_t)pwm_max[n]) {
// FIXME: disconnected?
- new_pwm = pwm_max[n];
+ log_byte(0xE1);
+ log_byte(n);
+ log_word(new_pwm);
+ log_word(adcval);
+ log_word(jiffies);
+ pwmled_state[n] = ST_DISABLED;
+ pwm_off(n);
+ return;
}
if (new_pwm < 1) {
probing = 1;
if (!probing) {
+ log_word(0x5555);
+ log_word(jiffies);
for (i = 0; i < N_PWMLEDS; i++)
log_byte(pwmled_state[i]);
log_word(pwm_vals[i]);
log_flush();
log_set_state(4);
+ for (i = 0; i < N_PWMLEDS; i++)
+ led_set_pattern(i, mode1_pattern);
}
#endif