#21079 - coredump - Sun May 23, 2004 4:19 pm
Hello,
I'm new on GBA development and I'd like to manage a timer for
buffered all gamepad during a moment in order to check eventual
"combos". So, my idea is to put the timer 2 on cascade and check
a "combos" during a cycle of 10 * 0.25us. Nothing work :(
my code:
thx.
I'm new on GBA development and I'd like to manage a timer for
buffered all gamepad during a moment in order to check eventual
"combos". So, my idea is to put the timer 2 on cascade and check
a "combos" during a cycle of 10 * 0.25us. Nothing work :(
my code:
Code: |
#define TIMER1_CR *(volatile u16 *)0x4000106 #define TIMER2_CR *(volatile u16 *)0x400010A #define TIMER1_DATA *(volatile u16 *)0x4000104 #define TIMER2_DATA *(volatile u16 *)0x4000108 #define ENABLE_TIMER (1 << 7) #define IRQ_TIMER (1 << 6) #define CASCADE_TIMER (1 << 2) #define RATIO_64 0x1 int get_key(void) { int key; u16 cycle; TIMER1_CR = RATIO_64 | ENABLE_TIMER | IRQ_TIMER; TIMER2_CR = CASCADE_TIMER | ENABLE_TIMER; key = 0; while ((cycle = TIMER2_DATA) < 10) { /* buffered key.*/ } return (key); } |
thx.