mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 05:05:20 -05:00
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
This commit is contained in:
parent
7bff585d83
commit
4a63ac7c00
2 changed files with 2 additions and 13 deletions
|
|
@ -304,6 +304,8 @@
|
|||
#define TDDATA1 (*(REG32_PTR_T)(0x3C70006C)) /* Data1 Register */
|
||||
#define TDPRE (*(REG32_PTR_T)(0x3C700070)) /* Pre-scale register */
|
||||
#define TDCNT (*(REG32_PTR_T)(0x3C700074)) /* Counter register */
|
||||
#define USEC_TIMER (((*(REG32_PTR_T)(0x3C700080) << 32) \
|
||||
| *(REG32_PTR_T)(0x3C700084)) * 5) /* 64bit 5usec timer */
|
||||
|
||||
/* 12. NAND FLASH CONTROLER */
|
||||
#if CONFIG_CPU==S5L8701
|
||||
|
|
|
|||
|
|
@ -40,18 +40,9 @@
|
|||
#include "power.h"
|
||||
#include "powermgmt.h"
|
||||
|
||||
#ifdef CPU_PP
|
||||
/* PortalPlayer uses the USEC timer */
|
||||
#define WHEEL_FAST_OFF_TIMEOUT 250000 /* timeout for acceleration = 250ms */
|
||||
#define WHEEL_REPEAT_TIMEOUT 250000 /* timeout for button repeat = 250ms */
|
||||
#define WHEEL_UNTOUCH_TIMEOUT 150000 /* timeout for untouching wheel = 150ms */
|
||||
#else
|
||||
/* Other targets use current_tick */
|
||||
#define WHEEL_FAST_OFF_TIMEOUT (HZ/4) /* timeout for acceleration = 250ms */
|
||||
#define WHEEL_REPEAT_TIMEOUT (HZ/4) /* timeout for button repeat = 250ms */
|
||||
#define WHEEL_UNTOUCH_TIMEOUT ((HZ*15)/100) /* timeout for untouching wheel = 150ms */
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef CPU_PP
|
||||
#define CLICKWHEEL_DATA (*(volatile unsigned long*)(0x7000c140))
|
||||
|
|
@ -131,11 +122,7 @@ static inline int ipod_4g_button_read(void)
|
|||
btn |= BUTTON_MENU;
|
||||
if (status & 0x40000000)
|
||||
{
|
||||
#ifdef CPU_PP
|
||||
unsigned long usec = USEC_TIMER;
|
||||
#else
|
||||
unsigned long usec = current_tick;
|
||||
#endif
|
||||
|
||||
/* Highest wheel = 0x5F, clockwise increases */
|
||||
new_wheel_value = (status >> 16) & 0x7f;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue