filename | test/timer.c |
changeset | 272:fb6be85235e8 |
prev | 262:bc96e0b79308 |
next | 731:ee2e929cca3a |
author | nkeynes |
date | Tue Jan 23 11:19:32 2007 +0000 (17 years ago) |
permissions | -rw-r--r-- |
last change | Refactor render buffer read/write to pvr2mem.c Implement 4-bit indexed textures (tentatively) Fix RGB24 support |
file | annotate | diff | log | raw |
1.1 --- a/test/timer.c Wed Jan 03 09:03:50 2007 +00001.2 +++ b/test/timer.c Tue Jan 23 11:19:32 2007 +00001.3 @@ -12,13 +12,21 @@1.4 * Initialize the on-chip timer controller. We snag TMU channel 2 in its1.5 * highest resolution mode, and start it counting down from max_int.1.6 */1.7 -void timer_start() {1.8 +void timer_init() {1.9 unsigned int val = byte_read(TSTR);1.10 byte_write( TSTR, val & (~(1<<TMU_CHANNEL)) ); /* Stop counter */1.11 long_write( TCOR(TMU_CHANNEL), 0xFFFFFFFF );1.12 long_write( TCNT(TMU_CHANNEL), 0xFFFFFFFF );1.13 word_write( TCR(TMU_CHANNEL), 0x00000000 );1.14 - byte_write( TSTR, val | (1<<TMU_CHANNEL) );1.15 +}1.16 +1.17 +void timer_run() {1.18 + byte_write( TSTR, byte_read(TSTR) | (1<<TMU_CHANNEL) );1.19 +}1.20 +1.21 +void timer_start() {1.22 + timer_init();1.23 + timer_run();1.24 }1.26 /**
.