Subversion Repositories freemyipod

Rev

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

Rev 308 Rev 390
Line 18... Line 18...
18
//    You should have received a copy of the GNU General Public License along
18
//    You should have received a copy of the GNU General Public License along
19
//    with emBIOS.  If not, see <http://www.gnu.org/licenses/>.
19
//    with emBIOS.  If not, see <http://www.gnu.org/licenses/>.
20
//
20
//
21
//
21
//
22
 
22
 
23
 
-
 
-
 
23
#define DEBUG_CONSOLES 2
24
#include "global.h"
24
#include "global.h"
25
#include "clickwheel.h"
25
#include "clickwheel.h"
26
#include "button.h"
26
#include "button.h"
27
#include "thread.h"
27
#include "thread.h"
28
#include "timer.h"
28
#include "timer.h"
Line 71... Line 71...
71
                    else button_send_event(BUTTON_PRESS, i, 0);
71
                    else button_send_event(BUTTON_PRESS, i, 0);
72
                }
72
                }
73
 
73
 
74
            if (newtouched)
74
            if (newtouched)
75
            {
75
            {
-
 
76
                int distance = 0;
76
                if (!oldtouched) button_send_event(WHEEL_TOUCH, 0, newpos);
77
                if (!oldtouched) button_send_event(WHEEL_TOUCH, 0, newpos);
-
 
78
                else distance = newpos - oldpos;
77
                button_send_event(WHEEL_POSITION, 0, newpos);
79
                button_send_event(WHEEL_POSITION, 0, newpos);
78
                int distance = newpos - oldpos;
-
 
79
                DEBUGF("Time since last packet: %d microseconds", USEC_TIMER - lastpacket);
80
                DEBUGF("Time since last packet: %d microseconds", USEC_TIMER - lastpacket);
80
                if (TIMEOUT_EXPIRED(lastpacket, 200000))
81
                if (TIMEOUT_EXPIRED(lastpacket, 200000))
81
                {
82
                {
82
                    DEBUGF("Resetting accel due to timeout");
83
                    DEBUGF("Resetting accel due to timeout");
83
                    packets = 10;
84
                    packets = 10;