From: Chris Bagwell <ch...@cnpbagwell.com> Old logic was relying on multiple sync windows occuring while out of proximity to reset averaging window; which doesn't always happen.
Signed-off-by: Chris Bagwell <ch...@cnpbagwell.com> --- src/wcmCommon.c | 16 +++++++--------- 1 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/wcmCommon.c b/src/wcmCommon.c index f77cad7..14f8f92 100644 --- a/src/wcmCommon.c +++ b/src/wcmCommon.c @@ -851,14 +851,10 @@ static int wcmCheckSuppress(WacomCommonPtr common, const WacomDeviceState* dsOri /* reset raw data counters for filters */ static void resetSampleCounter(const WacomChannelPtr pChannel) { - /* if out of proximity, reset hardware filter */ - if (!pChannel->valid.state.proximity) - { - pChannel->nSamples = 0; - pChannel->rawFilter.npoints = 0; - pChannel->rawFilter.statex = 0; - pChannel->rawFilter.statey = 0; - } + pChannel->nSamples = 0; + pChannel->rawFilter.npoints = 0; + pChannel->rawFilter.statex = 0; + pChannel->rawFilter.statey = 0; } /***************************************************************************** @@ -972,6 +968,9 @@ void wcmEvent(WacomCommonPtr common, unsigned int channel, if (RAW_FILTERING(common) && common->wcmModel->FilterRaw && ds.proximity && ds.device_type != PAD_ID) { + if (!pLast->proximity) + resetSampleCounter(pChannel); + if (common->wcmModel->FilterRaw(common,pChannel,&ds)) { DBG(10, common, @@ -985,7 +984,6 @@ void wcmEvent(WacomCommonPtr common, unsigned int channel, suppress = wcmCheckSuppress(common, pLast, &ds); if (!suppress) { - resetSampleCounter(pChannel); return; } } -- 1.7.3.1 ------------------------------------------------------------------------------ Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel