It looks like you're coding for an AVR.
Don't do this. Use the definitions of these registers provided by your compiler.
As written, your code specifies that the Timer1_str
structure will exist at some location in system memory to be determined by the linker. Without any additional support, this code will not work, because this structure will be mapped to SRAM, causing writes to it to have no special effects. Even if you use the linker to map this structure to the appropriate addresses (which may or may not be possible), the code generated by the compiler to work with it will be suboptimal, because it will be unable to use the IN
and OUT
instructions to manipulate these registers. (To generate these instructions, the address being written to must be known at compile time.) Additionally, the compiler may generate code which does not access these registers appropriately - for instance, here it may generate writes to TCNT in the wrong order.