Steve
Your call to gosub ServiceHardw is the culprit. It nests other subroutines. This is what may be consuming the time. I can recommend you replace the call to gosub ServiceHardw with a bit variable getting set. You then check the bit variable in your mainline code to decide if you need to serviceHardw. It will definitely yield results.Code:Checkscore: 'Determine if a button is pressed (count is less than average) If timerave[index] - (timerave[index] /50) > timercount[index] and (delay > 1000) then gosub ServiceHardw 'Signal that a button is pressed. endif
In your main, put thisCode:Checkscore: 'Determine if a button is pressed (count is less than average) If timerave[index] - (timerave[index] /50) > timercount[index] and (delay > 1000) then ServiceHw=1 endif
Code:ServiceHw var bit ' declarations section If ServiceHw then gosub ServiceHw
Jerson


I had to change the Timer resource from TMR2 to TMR0 and I enabled it's interrupt unnecessarily. Thanks! Turning TMR0 interrupt off helped but didn't completely cure the problem.



Bookmarks