freemyipod r539 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r538‎ | r539 | r540 >
Date:18:51, 6 February 2011
Author:theseven
Status:new
Tags:
Comment:
emCORE: Implement WHEEL_MOVED_ACCEL events in iPod Nano 2G clickwheel driver
Modified paths:
  • /emcore/trunk/target/ipodnano2g/clickwheel.c (modified) (history)

Diff [purge]

Index: emcore/trunk/target/ipodnano2g/clickwheel.c
@@ -95,8 +95,9 @@
9696 if (distance < -48) distance += 96;
9797 else if (distance > 48) distance -= 96;
9898 DEBUGF("Wheel moved %d units without accel", distance);
 99+ button_send_event(WHEEL_MOVED, 0, distance);
99100 DEBUGF("Wheel moved %d units with accel", distance * packets);
100 - button_send_event(WHEEL_MOVED, 0, distance);
 101+ button_send_event(WHEEL_MOVED_ACCEL, 0, distance * packets);
101102 collect += distance * packets;
102103 enum button_event e = collect > 0 ? WHEEL_FORWARD : WHEEL_BACKWARD;
103104 int data = (collect > 0 ? collect : -collect) / 128;