pwmled_t pwmleds[N_PWMLEDS];
-#define PWMLED2_TESTING_WITH_350MA_LED
-
-#define SENSE_MOHM 33 /* 0.033 Ohm */
+#define SENSE_MOHM 1000 /* 1 Ohm */
/*
* Voltage in uV at ADC reading == 1 is 1100/gain/1024
* ADC module returns sum of 1 << PWMLED_ADC_SHIFT measurements
/ (1100000/(gain))))
static uint16_t adc_max[N_PWMLEDS] = {
-#ifdef TESTING_FW
- MA_GAIN_TO_ADC( 400, 20),
- MA_GAIN_TO_ADC( 30, 20),
- MA_GAIN_TO_ADC( 800, 1)
-#else
- MA_GAIN_TO_ADC( 900, 20),
- MA_GAIN_TO_ADC( 30, 20),
- MA_GAIN_TO_ADC(2500, 1)
-#endif
+ MA_GAIN_TO_ADC( 30, 1),
+ MA_GAIN_TO_ADC( 30, 1),
};
static uint16_t adc_vals[N_PWMLEDS*N_PWMLED_MODES] = {
-#ifdef TESTING_FW
- /* pwmled0 */
- MA_GAIN_TO_ADC( 50, 20),
- MA_GAIN_TO_ADC( 100, 20),
- MA_GAIN_TO_ADC( 200, 20),
- MA_GAIN_TO_ADC( 350, 20),
- /* pwmled1 */
- MA_GAIN_TO_ADC( 5, 20),
- MA_GAIN_TO_ADC( 10, 20),
- MA_GAIN_TO_ADC( 15, 20),
- MA_GAIN_TO_ADC( 20, 20),
- /* pwmled2 */
- MA_GAIN_TO_ADC( 50, 1),
- MA_GAIN_TO_ADC( 80, 1),
- MA_GAIN_TO_ADC( 150, 1),
- MA_GAIN_TO_ADC( 200, 1)
-#else
/* pwmled0 */
- MA_GAIN_TO_ADC( 50, 20),
- MA_GAIN_TO_ADC( 100, 20),
- MA_GAIN_TO_ADC( 200, 20),
- MA_GAIN_TO_ADC( 350, 20),
+ MA_GAIN_TO_ADC( 5, 1),
+ MA_GAIN_TO_ADC( 10, 1),
+ MA_GAIN_TO_ADC( 15, 1),
+ MA_GAIN_TO_ADC( 20, 1),
/* pwmled1 */
- MA_GAIN_TO_ADC( 5, 20),
- MA_GAIN_TO_ADC( 10, 20),
- MA_GAIN_TO_ADC( 18, 20),
- MA_GAIN_TO_ADC( 23, 20),
- /* pwmled2 */
- MA_GAIN_TO_ADC( 150, 1),
- MA_GAIN_TO_ADC( 300, 1),
- MA_GAIN_TO_ADC( 800, 1),
- MA_GAIN_TO_ADC(1500, 1)
-#endif
+ MA_GAIN_TO_ADC( 5, 1),
+ MA_GAIN_TO_ADC( 10, 1),
+ MA_GAIN_TO_ADC( 15, 1),
+ MA_GAIN_TO_ADC( 20, 1),
};
#define ST_DISABLED 0
log_byte(0xF0);
log_byte(n);
- log_word(jiffies);
+ // log_word(jiffies);
for (i = 0; i < N_PWMLED_MODES; i++)
log_word(led->mode_pwm[i]);
log_flush();
- pattern_reload();
+ // pattern_reload();
+ // pwmled_set_mode(n, 2);
return 1;
}
log_byte(0xF1);
log_byte(n);
- log_word(jiffies);
+ // log_word(jiffies);
log_flush();
}
led->err_sum = sum;
if (led->pwm >= PWM_MAX
- || (n == 1 && led->pwm > PWM_MAX/2 && adcval < 0x08)) {
+ || (led->pwm > (2*PWM_MAX/3) && adcval < 0x08)) {
pwmled_err(n);
return;
}