Forget all the nonsense with C delay loops. 'volatile' on the variable makes bloated...