freemyipod r390 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r389‎ | r390 | r391 >
Date:01:21, 28 December 2010
Author:theseven
Status:new
Tags:
Comment:
emBIOS: Fix spurious wheel rotation events if the wheel was untouched in the meantime
Modified paths:
  • /embios/trunk/target/ipodnano3g/clickwheel.c (modified) (history)

Diff [purge]

Index: embios/trunk/target/ipodnano3g/clickwheel.c
@@ -20,7 +20,7 @@
2121 //
2222 //
2323
24 -
 24+#define DEBUG_CONSOLES 2
2525 #include "global.h"
2626 #include "clickwheel.h"
2727 #include "button.h"
@@ -73,9 +73,10 @@
7474
7575 if (newtouched)
7676 {
 77+ int distance = 0;
7778 if (!oldtouched) button_send_event(WHEEL_TOUCH, 0, newpos);
 79+ else distance = newpos - oldpos;
7880 button_send_event(WHEEL_POSITION, 0, newpos);
79 - int distance = newpos - oldpos;
8081 DEBUGF("Time since last packet: %d microseconds", USEC_TIMER - lastpacket);
8182 if (TIMEOUT_EXPIRED(lastpacket, 200000))
8283 {