summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/test/kernel/timer.c64
1 files changed, 0 insertions, 64 deletions
diff --git a/firmware/test/kernel/timer.c b/firmware/test/kernel/timer.c
deleted file mode 100644
index a0d180ab51..0000000000
--- a/firmware/test/kernel/timer.c
+++ /dev/null
@@ -1,64 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
11 *
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.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19#include "sh7034.h"
20#include "system.h"
21#include "debug.h"
22#include "kernel.h"
23
24void tick_start(unsigned int interval_in_ms)
25{
26 unsigned int count;
27
28 count = FREQ / 1000 / 8 * interval_in_ms;
29
30 debugf("count = %d\n", count);
31 if(count > 0xffff)
32 {
33 debugf("Error! The tick interval is too long (%d ms)\n",
34 interval_in_ms);
35 return;
36 }
37
38 /* We are using timer 0 */
39
40 TSTR &= ~0x01; /* Stop the timer */
41 TSNC &= ~0x01; /* No synchronization */
42 TMDR &= ~0x01; /* Operate normally */
43
44 TCNT0 = 0; /* Start counting at 0 */
45 GRA0 = count;
46 TCR0 = 0x23; /* Clear at GRA match, sysclock/8 */
47
48 /* Enable interrupt on level 1 */
49 IPRC = (IPRC & ~0x00f0) | 0x0010;
50
51 TSR0 &= ~0x01;
52 TIER0 = 0xf9; /* Enable GRA match interrupt */
53
54 TSTR |= 0x01; /* Start timer 1 */
55}
56
57#pragma interrupt
58void IMIA0(void)
59{
60 current_tick++;
61
62// debugf("t\n");
63 TSR0 &= ~0x01;
64}