diff options
author | Daniel Friesel <derf@finalrewind.org> | 2011-12-26 23:16:25 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2011-12-26 23:16:25 +0100 |
commit | 3b287851e48c926fe17eea44e8042465e5435914 (patch) | |
tree | fd8446aa960711e9675c647aff63ae3d6850beff | |
parent | b9dc08bef55da6a3df58b1e406aaa40a7563b9d7 (diff) |
wibble: Calculation adjustments
-rw-r--r-- | wibble.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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) ); |