summaryrefslogtreecommitdiff
path: root/firmware/target/arm/ipod/button-clickwheel.c
diff options
context:
space:
mode:
authorMichael Sparmann <theseven@rockbox.org>2009-10-21 18:53:41 +0000
committerMichael Sparmann <theseven@rockbox.org>2009-10-21 18:53:41 +0000
commit4a63ac7c00a6d560b1429315fbeba3dced5376f8 (patch)
tree727d6a01f2b5d04a9f85a22a333baaf674e546e2 /firmware/target/arm/ipod/button-clickwheel.c
parent7bff585d83444dba96c952578a265a5537fec459 (diff)
downloadrockbox-4a63ac7c00a6d560b1429315fbeba3dced5376f8.tar.gz
rockbox-4a63ac7c00a6d560b1429315fbeba3dced5376f8.zip
Add iPod Nano 2G µsec timer, and use it in the clickwheel driver.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23309 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/ipod/button-clickwheel.c')
-rw-r--r--firmware/target/arm/ipod/button-clickwheel.c13
1 files changed, 0 insertions, 13 deletions
diff --git a/firmware/target/arm/ipod/button-clickwheel.c b/firmware/target/arm/ipod/button-clickwheel.c
index 17f9f723f5..9a2f38bc88 100644
--- a/firmware/target/arm/ipod/button-clickwheel.c
+++ b/firmware/target/arm/ipod/button-clickwheel.c
@@ -40,18 +40,9 @@
40#include "power.h" 40#include "power.h"
41#include "powermgmt.h" 41#include "powermgmt.h"
42 42
43#ifdef CPU_PP
44/* PortalPlayer uses the USEC timer */
45#define WHEEL_FAST_OFF_TIMEOUT 250000 /* timeout for acceleration = 250ms */ 43#define WHEEL_FAST_OFF_TIMEOUT 250000 /* timeout for acceleration = 250ms */
46#define WHEEL_REPEAT_TIMEOUT 250000 /* timeout for button repeat = 250ms */ 44#define WHEEL_REPEAT_TIMEOUT 250000 /* timeout for button repeat = 250ms */
47#define WHEEL_UNTOUCH_TIMEOUT 150000 /* timeout for untouching wheel = 150ms */ 45#define WHEEL_UNTOUCH_TIMEOUT 150000 /* timeout for untouching wheel = 150ms */
48#else
49/* Other targets use current_tick */
50#define WHEEL_FAST_OFF_TIMEOUT (HZ/4) /* timeout for acceleration = 250ms */
51#define WHEEL_REPEAT_TIMEOUT (HZ/4) /* timeout for button repeat = 250ms */
52#define WHEEL_UNTOUCH_TIMEOUT ((HZ*15)/100) /* timeout for untouching wheel = 150ms */
53
54#endif
55 46
56#ifdef CPU_PP 47#ifdef CPU_PP
57#define CLICKWHEEL_DATA (*(volatile unsigned long*)(0x7000c140)) 48#define CLICKWHEEL_DATA (*(volatile unsigned long*)(0x7000c140))
@@ -131,11 +122,7 @@ static inline int ipod_4g_button_read(void)
131 btn |= BUTTON_MENU; 122 btn |= BUTTON_MENU;
132 if (status & 0x40000000) 123 if (status & 0x40000000)
133 { 124 {
134#ifdef CPU_PP
135 unsigned long usec = USEC_TIMER; 125 unsigned long usec = USEC_TIMER;
136#else
137 unsigned long usec = current_tick;
138#endif
139 126
140 /* Highest wheel = 0x5F, clockwise increases */ 127 /* Highest wheel = 0x5F, clockwise increases */
141 new_wheel_value = (status >> 16) & 0x7f; 128 new_wheel_value = (status >> 16) & 0x7f;