summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-12-26 23:16:25 +0100
committerDaniel Friesel <derf@finalrewind.org>2011-12-26 23:16:25 +0100
commit3b287851e48c926fe17eea44e8042465e5435914 (patch)
treefd8446aa960711e9675c647aff63ae3d6850beff
parentb9dc08bef55da6a3df58b1e406aaa40a7563b9d7 (diff)
wibble: Calculation adjustments
-rw-r--r--wibble.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/wibble.c b/wibble.c
index 611a9f8..3b11750 100644
--- a/wibble.c
+++ b/wibble.c
@@ -298,12 +298,12 @@ void handle_acc_auto(cwiid_wiimote_t *wiimote, struct cwiid_acc_mesg *am,
}
if ((a_y < -2) && !w_start)
- w_start = now;
- else if (a_y < -2) {
+ w_start = w_last = now;
+ else if ((a_y < -2) && ((now - w_last) > 0.2)) {
w_count++;
w_last = now;
if (w_count > 5) {
- printf("\r\033[2K8====) Wanking for %.f seconds at %4.1fHz",
+ printf("\r\033[2K%.f seconds at %4.1fHz",
w_last - w_start,
w_count / (w_last - w_start)
);