Subversion Repositories freemyipod

Rev

Rev 429 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 429 Rev 539
Line 93... Line 93...
93
                lastdiff = distance;
93
                lastdiff = distance;
94
                if (packets > 200) packets = 200;
94
                if (packets > 200) packets = 200;
95
                if (distance < -48) distance += 96;
95
                if (distance < -48) distance += 96;
96
                else if (distance > 48) distance -= 96;
96
                else if (distance > 48) distance -= 96;
97
                DEBUGF("Wheel moved %d units without accel", distance);
97
                DEBUGF("Wheel moved %d units without accel", distance);
98
                DEBUGF("Wheel moved %d units with accel", distance * packets);
-
 
99
                button_send_event(WHEEL_MOVED, 0, distance);
98
                button_send_event(WHEEL_MOVED, 0, distance);
-
 
99
                DEBUGF("Wheel moved %d units with accel", distance * packets);
-
 
100
                button_send_event(WHEEL_MOVED_ACCEL, 0, distance * packets);
100
                collect += distance * packets;
101
                collect += distance * packets;
101
                enum button_event e = collect > 0 ? WHEEL_FORWARD : WHEEL_BACKWARD;
102
                enum button_event e = collect > 0 ? WHEEL_FORWARD : WHEEL_BACKWARD;
102
                int data = (collect > 0 ? collect : -collect) / 128;
103
                int data = (collect > 0 ? collect : -collect) / 128;
103
                if (data) button_send_event(e, 0, data);
104
                if (data) button_send_event(e, 0, data);
104
                collect %= 128;
105
                collect %= 128;