Page 1 of 1

Global register variable?

Posted: Sun Jan 01, 2012 5:47 am
by zhiayang
Since this is a general programming sub-forum, I figure it would be the best place to post it. Now, I have this problem: I recently switched to using unsigned long for my timer_ticks variable. I then re-read my [ Teach yourself C 2nd ed] Crap yes, useful, rarely. like, in this case. Anyway, I discovered the use of the "register" variable modifier.

Now the problem is, you can't make it static or global. The timer is programmed to 100hz, so I figured it would be good to optimise that code. How would one optimise that portion of code, or is there no way to optimise it further?

Re: Global register variable?

Posted: Sun Jan 01, 2012 12:51 pm
by zhiayang
I see, thanks.