I have a subroutine which sorts a large list of numeric data. The problem is that for a sufficiently large dataset the subroutine will take so long to complete that the watchdog is activated.
So I'm trying to get around this problem by having a timer which lets the routine run for a second before returning to finish the scan and then going back in on the next scan and so forth.
But I've been unable to make this work. Any ideas? Here's what I've done:
Main:
...
---[]---SBR
...
SBR:
---[Sort done]---RET
---(Set timer)---[timer]------RET
....................................|
....................................-----(reset timer)
...
So I'm trying to get around this problem by having a timer which lets the routine run for a second before returning to finish the scan and then going back in on the next scan and so forth.
But I've been unable to make this work. Any ideas? Here's what I've done:
Main:
...
---[]---SBR
...
SBR:
---[Sort done]---RET
---(Set timer)---[timer]------RET
....................................|
....................................-----(reset timer)
...