diff options
-rw-r--r-- | firmware/target/coldfire/mpio/hd200/button-hd200.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/firmware/target/coldfire/mpio/hd200/button-hd200.c b/firmware/target/coldfire/mpio/hd200/button-hd200.c index b40c3324e1..dbc558a52e 100644 --- a/firmware/target/coldfire/mpio/hd200/button-hd200.c +++ b/firmware/target/coldfire/mpio/hd200/button-hd200.c | |||
@@ -49,10 +49,6 @@ int button_read_device(void) | |||
49 | int data = 0; | 49 | int data = 0; |
50 | static bool hold_button = false; | 50 | static bool hold_button = false; |
51 | 51 | ||
52 | /* for moving average filter */ | ||
53 | static unsigned short button_filter[4]; | ||
54 | static unsigned char index; | ||
55 | |||
56 | bool hold_button_old; | 52 | bool hold_button_old; |
57 | 53 | ||
58 | /* normal buttons */ | 54 | /* normal buttons */ |
@@ -67,14 +63,7 @@ int button_read_device(void) | |||
67 | 63 | ||
68 | if (!hold_button) | 64 | if (!hold_button) |
69 | { | 65 | { |
70 | 66 | data = adc_scan(ADC_BUTTONS); | |
71 | /* simple moving average filter with 4 item window */ | ||
72 | button_filter[index&0x03] = adc_scan(ADC_BUTTONS); | ||
73 | index++; | ||
74 | |||
75 | data = (button_filter[0]+button_filter[1] \ | ||
76 | +button_filter[2]+button_filter[3])>>2; | ||
77 | |||
78 | 67 | ||
79 | if (data < 2250) // valid button | 68 | if (data < 2250) // valid button |
80 | { | 69 | { |