forked from len0rd/rockbox
HD200 - remove moving average filtering of ADC readouts
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25765 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
fe147cec65
commit
2a50270e44
1 changed files with 1 additions and 12 deletions
|
|
@ -49,10 +49,6 @@ int button_read_device(void)
|
|||
int data = 0;
|
||||
static bool hold_button = false;
|
||||
|
||||
/* for moving average filter */
|
||||
static unsigned short button_filter[4];
|
||||
static unsigned char index;
|
||||
|
||||
bool hold_button_old;
|
||||
|
||||
/* normal buttons */
|
||||
|
|
@ -67,14 +63,7 @@ int button_read_device(void)
|
|||
|
||||
if (!hold_button)
|
||||
{
|
||||
|
||||
/* simple moving average filter with 4 item window */
|
||||
button_filter[index&0x03] = adc_scan(ADC_BUTTONS);
|
||||
index++;
|
||||
|
||||
data = (button_filter[0]+button_filter[1] \
|
||||
+button_filter[2]+button_filter[3])>>2;
|
||||
|
||||
data = adc_scan(ADC_BUTTONS);
|
||||
|
||||
if (data < 2250) // valid button
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue