mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 13:15:18 -05:00
Gigabeat S: Implement a genuine udelay function. Timer is gated to not run in WFI mode to save power and as such time until rollover is variable.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19820 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
da76a34694
commit
7bcfc38b42
4 changed files with 123 additions and 19 deletions
|
|
@ -31,25 +31,18 @@
|
|||
#define CPUFREQ_MAX CPU_FREQ
|
||||
#endif
|
||||
|
||||
/* For USB driver - no accuracy assurance */
|
||||
static inline void udelay(unsigned int usecs)
|
||||
{
|
||||
unsigned int x;
|
||||
for (x = 0; x < 300*usecs; x++)
|
||||
asm volatile ("");
|
||||
unsigned stop = GPTCNT + usecs;
|
||||
while (TIME_BEFORE(GPTCNT, stop));
|
||||
}
|
||||
|
||||
#if 0
|
||||
static inline void udelay(unsigned int usecs)
|
||||
{
|
||||
volatile signed int stop = EPITCNT1 - usecs;
|
||||
while ((signed int)EPITCNT1 > stop);
|
||||
}
|
||||
#endif
|
||||
|
||||
void watchdog_init(unsigned int half_seconds);
|
||||
void watchdog_service(void);
|
||||
|
||||
void gpt_start(void);
|
||||
void gpt_stop(void);
|
||||
|
||||
/* Prepare for transition to firmware */
|
||||
void system_prepare_fw_start(void);
|
||||
void tick_stop(void);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue