You defined timer as a pointer to int (=32bit) but then you used it with byte address increments, so you are not writing the correct registers.
Anyway this is a deprecated way of programming.
A few hints:
- use the symbolic defines generated by sopc builder (in system.h file) instead of the numeric addresses 0x10000000, 0x10002000 which would possibly change if you regenerate the system
- don't use pointers but rather the IOWR/IORD macros which automatically match the addressed memory data size
- in this case it would be even better exploiting the timer control macros (IOWR_ALTERA_AVALON_TIMER_CONTROL, IOWR_ALTERA_AVALON_TIMER_PERIODL, ...) available in the HAL driver.