From 24d27b840bb41de88ab6bdece4d66b79e77a821a Mon Sep 17 00:00:00 2001 From: John Nye Date: Tue, 22 Jan 2013 22:57:54 +0000 Subject: [PATCH] update to fix ticket #457 This caps the wattage at 4kW, and hence the torque values also. It's fairly safe to assume that no-one will be producing 4kW on a PowerTap --- src/PowerTapUtil.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/PowerTapUtil.cpp b/src/PowerTapUtil.cpp index 8948de312..efc958a96 100644 --- a/src/PowerTapUtil.cpp +++ b/src/PowerTapUtil.cpp @@ -131,6 +131,9 @@ PowerTapUtil::unpack_data(unsigned char *buf, double rec_int_secs, else { *watts = ((buf[2] & 0x0f) << 8) | buf[3]; + if(*watts >= 4000.00) + *watts = 0.0; + *cad = buf[4]; if (*cad == 0xff) *cad = 0;