Interrupt refreshing help

You want us to debug pseudo code? Afraid not. Actual code please.

Read this before posting a programming question