Fix problem where follow playlist picks the next track, not the current one (FS#7244...
[Rockbox.git] / firmware / export / timer.h
blob35994ce5f29b842fd2865204364c4b2445932027
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2005 Jens Arnold
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
20 #ifndef __TIMER_H__
21 #define __TIMER_H__
23 #include <stdbool.h>
24 #include "config.h"
26 #ifndef SIMULATOR
29 #if defined(CPU_PP)
30 /* Portalplayer chips use a microsecond timer. */
31 #define TIMER_FREQ 1000000
32 #elif defined(CPU_COLDFIRE)
33 /* timer is based on busclk == cpuclk/2 */
34 #define TIMER_FREQ (CPU_FREQ/2)
35 #elif CONFIG_CPU == PNX0101
36 #define TIMER_FREQ 3000000
37 #else
38 #define TIMER_FREQ CPU_FREQ
39 #endif
41 bool timer_register(int reg_prio, void (*unregister_callback)(void),
42 long cycles, int int_prio, void (*timer_callback)(void));
43 bool timer_set_period(long cycles);
44 #ifdef CPU_COLDFIRE
45 void timers_adjust_prescale(int multiplier, bool enable_irq);
46 #endif
47 void timer_unregister(void);
49 #endif /* !SIMULATOR */
50 #endif /* __TIMER_H__ */