#114732 - Minco - Wed Jan 10, 2007 2:58 pm
I tried using the code from KrakKeN's GBA Timers tutorial, which can be found here: http://www.gbadev.org/docs.php?showinfo=43
When I try to compile a simple program using this delay function, I immediately get the following errors:
compiler_test.c: In function `DelayExecution':
compiler_test.c:29: warning: assignment makes pointer from integer without a cast
compiler_test.c:30: warning: assignment makes pointer from integer without a cast
compiler_test.c:32: warning: comparison between pointer and integer
compiler_test.c:33: warning: comparison between pointer and integer
In the code this will be the following lines:
line 29: REG_TMCNT[2] = (TIMEENABLE | TIME256);
line 30: REG_TMCNT[3] = (TIMEOVERFLOW | TIMEENABLE);
line 31: REG_TMD[2] = REG_TMD[3] = 0;
line 32: while (REG_TMD[3] < iSecs) { /*/ Do Nothing /*/ }
line 33: while (REG_TMD[2] < (65535 / 1000) * iMilliSecs) { /*/ Do Nothing /*/ }
I've just copy pasted the code from KrakKeN's GBA Timers Tutorial, but I immediately get this errors. When I try to set a delay, let's say 1000 milliseconds, like DelayExecution(1000);, the program immediately 'crashes' at that point.
How can I fix this errors and fix this timer problem? (By the way, does anyone know a good other timing tutorial?)
Thanks!
(p.s. if someone else also got some working functions for setting delays or setting a counter which will return a value after a given time interval or something like that, please let me know --> arjan.van.bremen@gmail.com)
Last edited by Minco on Wed Jan 10, 2007 7:21 pm; edited 1 time in total
When I try to compile a simple program using this delay function, I immediately get the following errors:
compiler_test.c: In function `DelayExecution':
compiler_test.c:29: warning: assignment makes pointer from integer without a cast
compiler_test.c:30: warning: assignment makes pointer from integer without a cast
compiler_test.c:32: warning: comparison between pointer and integer
compiler_test.c:33: warning: comparison between pointer and integer
In the code this will be the following lines:
line 29: REG_TMCNT[2] = (TIMEENABLE | TIME256);
line 30: REG_TMCNT[3] = (TIMEOVERFLOW | TIMEENABLE);
line 31: REG_TMD[2] = REG_TMD[3] = 0;
line 32: while (REG_TMD[3] < iSecs) { /*/ Do Nothing /*/ }
line 33: while (REG_TMD[2] < (65535 / 1000) * iMilliSecs) { /*/ Do Nothing /*/ }
I've just copy pasted the code from KrakKeN's GBA Timers Tutorial, but I immediately get this errors. When I try to set a delay, let's say 1000 milliseconds, like DelayExecution(1000);, the program immediately 'crashes' at that point.
How can I fix this errors and fix this timer problem? (By the way, does anyone know a good other timing tutorial?)
Thanks!
(p.s. if someone else also got some working functions for setting delays or setting a counter which will return a value after a given time interval or something like that, please let me know --> arjan.van.bremen@gmail.com)
Last edited by Minco on Wed Jan 10, 2007 7:21 pm; edited 1 time in total