diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2002-05-05 17:49:25 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2002-05-05 17:49:25 +0000 |
commit | 324cfa4f95d08ea6a332714bd395c05ee3ed7b6b (patch) | |
tree | 906bb3cb1dc31b998ddbd128c8d068305940660c /firmware/test | |
parent | 75e8cbbdcc3e25a73baf8febc08c5f3b1c716f44 (diff) | |
download | rockbox-324cfa4f95d08ea6a332714bd395c05ee3ed7b6b.tar.gz rockbox-324cfa4f95d08ea6a332714bd395c05ee3ed7b6b.zip |
*** empty log message ***
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@446 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/test')
-rw-r--r-- | firmware/test/kernel/timer.c | 64 |
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 | |||
24 | void 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 | ||
58 | void IMIA0(void) | ||
59 | { | ||
60 | current_tick++; | ||
61 | |||
62 | // debugf("t\n"); | ||
63 | TSR0 &= ~0x01; | ||
64 | } | ||