diff options
author | Karl Kurbjun <kkurbjun@gmail.com> | 2011-02-06 19:26:31 +0000 |
---|---|---|
committer | Karl Kurbjun <kkurbjun@gmail.com> | 2011-02-06 19:26:31 +0000 |
commit | 52b0605fb41ae72b95246a92431221637e1e377a (patch) | |
tree | 0daf7813584e5427d6c4e369afa1863b21b8b528 /firmware/drivers/tsc2100.c | |
parent | 055cb9af500380420b7d85c09cf02dfe9a46fdb1 (diff) |
TSC2100: Sample multiple times and provide an average to clean up touch detection.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29218 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/tsc2100.c')
-rw-r--r-- | firmware/drivers/tsc2100.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/firmware/drivers/tsc2100.c b/firmware/drivers/tsc2100.c index b8edb7d52d..433e1ce6a5 100644 --- a/firmware/drivers/tsc2100.c +++ b/firmware/drivers/tsc2100.c @@ -81,8 +81,10 @@ void tsc2100_set_mode(bool poweron, unsigned char scan_mode) { short tsadc=(scan_mode<<TSADC_ADSCM_SHIFT)| /* mode */ (0x3<<TSADC_RESOL_SHIFT)| /* 12 bit resolution */ + (0x2<<TSADC_ADAVG_SHIFT)| /* 8 or 9 sample average */ (0x2<<TSADC_ADCR_SHIFT )| /* 2 MHz internal clock */ - (0x2<<TSADC_PVSTC_SHIFT); + (0x3<<TSADC_PVSTC_SHIFT)| /* 1 ms stabalization */ + (TSADC_AVGFS); /* Median filter ( 9 sample ) */ if(!poweron) { |