]> www.fi.muni.cz Git - bike-lights.git/blobdiff - firmware/pwmled.c
Error flags, error reporting
[bike-lights.git] / firmware / pwmled.c
index 82237dca936b6783c38c778b6e820277bd8742f6..30b10f1d307c0c501ac57fc49ff0e587b860ffdb 100644 (file)
@@ -57,17 +57,17 @@ static uint16_t adc_targets_1[] = {
 
 static uint16_t adc_targets_2[] = {
 #ifdef TESTING_FW
-       MA_GAIN_TO_ADC(  50,  1),
-       MA_GAIN_TO_ADC( 100,  1),
-       MA_GAIN_TO_ADC( 150,  1),
+       MA_GAIN_TO_ADC( 120,  1),
+       MA_GAIN_TO_ADC( 160,  1),
        MA_GAIN_TO_ADC( 240,  1),
-       MA_GAIN_TO_ADC( 350,  1),
+       MA_GAIN_TO_ADC( 320,  1),
+       MA_GAIN_TO_ADC( 460,  1),
 #else
        MA_GAIN_TO_ADC( 150,  1),
        MA_GAIN_TO_ADC( 300,  1),
        MA_GAIN_TO_ADC( 500,  1),
-       MA_GAIN_TO_ADC( 800,  1),
-       MA_GAIN_TO_ADC(1200,  1),
+       MA_GAIN_TO_ADC( 700,  1),
+       MA_GAIN_TO_ADC(1500,  1),
 #endif
 };
 
@@ -225,6 +225,12 @@ static inline void pwmled_err(unsigned char n)
        log_byte(n);
        log_word(jiffies);
        log_flush();
+
+       switch (n) {
+       case 0: err_flags.err_pwmled0 = 1; break;
+       case 1: err_flags.err_pwmled1 = 1; break;
+       case 2: err_flags.err_pwmled2 = 1; break;
+       }
 }