diff options
author | Marcin Bukat <marcin.bukat@gmail.com> | 2010-04-30 12:42:51 +0000 |
---|---|---|
committer | Marcin Bukat <marcin.bukat@gmail.com> | 2010-04-30 12:42:51 +0000 |
commit | 2a50270e44ae03e4e5e7fee72f1f7f6db54be54b (patch) | |
tree | 07bc82b86109df8ebc9c15efdf66b8a366b7a070 | |
parent | fe147cec651486d39967f24d0d1bbe6ae1cd067b (diff) | |
download | rockbox-2a50270e44ae03e4e5e7fee72f1f7f6db54be54b.tar.gz rockbox-2a50270e44ae03e4e5e7fee72f1f7f6db54be54b.zip |
HD200 - remove moving average filtering of ADC readouts
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25765 a1c6a512-1295-4272-9138-f99709370657
-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 | { |