]> www.fi.muni.cz Git - tinyboard.git/blobdiff - projects/step-up/adc.c
Merge branch 'master' of ssh://anxur.fi.muni.cz/~kas/html/git/tinyboard
[tinyboard.git] / projects / step-up / adc.c
index 326588a1253d5dc8cbba468d918cf87432852e08..ea309357a429ad988b26960e3e1c381bda7248a9 100644 (file)
@@ -11,7 +11,7 @@
 #define NUM_ADCS       2
 
 volatile static unsigned char current_adc;;
-static unsigned char need_battery_adc;
+volatile unsigned char need_battery_adc;
 static uint16_t adc_sum, read_zero, drop_count, read_count, n_reads_log;
 volatile uint16_t jiffies;
 
@@ -126,30 +126,9 @@ void susp_adc()
        DIDR0 = 0;
 }
 
-static void inline adc_based_timer()
-{
-       static unsigned char count;
-
-       if (++count < 40) // about 100 Hz jiffies
-               return;
-
-       count = 0;
-       ++jiffies;
-
-       if ((jiffies & 0x007F) == 1) { // about every 1s
-               need_battery_adc = 1;
-       }
-       if ((jiffies & 0x0007) == 0) {
-               patterns_next_tick();
-       }
-       timer_check_buttons();
-}
-
 ISR(ADC_vect) { // IRQ handler
        uint16_t adcval = ADCW;
 
-       adc_based_timer();
-
        if (read_zero) {
                setup_mux(current_adc);
                read_zero = 0;