altos/lpc: Get rid of ADC filter
[fw/altos] / src / lpc / ao_adc_lpc.c
index 40173aa451315e371044a5c30e5d868b0369df3f..874d2d294cb6a08db5a7bd3f9731953f3beb890a 100644 (file)
 
 static uint8_t         ao_adc_ready;
 
-static uint16_t                ao_adc_prev[AO_NUM_ADC];
-
-#define sample(id)     do {                            \
-               uint16_t        p = *prev;              \
-               uint16_t        v = lpc_adc.dr[id];     \
-               p -= p >> 4;                            \
-               p += v >> 4;                            \
-               *prev++ = p;                            \
-               *out++ = p >> 1;                        \
-       } while (0)
+#define sample(id)     (*out++ = lpc_adc.dr[id] >> 1)
 
 void  lpc_adc_isr(void)
 {
        uint32_t        stat = lpc_adc.stat;
        uint16_t        *out;
-       uint16_t        *prev;
 
        /* Turn off burst mode */
        lpc_adc.cr = 0;
@@ -119,7 +109,6 @@ void  lpc_adc_isr(void)
        /* Store converted values in packet */
 
        out = (uint16_t *) &ao_data_ring[ao_data_head].adc;
-       prev = ao_adc_prev;
 #if AO_ADC_0
        sample(0);
 #endif