My test code is below. First I'm a beginner but I'm trying to hook up a flow meter to the ZX. This little test runs (StatusTask=3) and then terminates fine (StatusTask=255). My question is how do I restart the task so it can start watching the interrupt again once it terminates?
For my project I need to see when the interrupt fires and count the pulses or transitions on that pin (code not in place yet). Once I have the pulse count I want to restart the task but I'm unsure how to do that. I've tried to CallTask again when the StatusTask=255 in the loop but it still remains terminated.
Thanks
David
Code: Select all
Dim SerTaskStack(1 to 40) As Byte
Sub Main()
CallTask "TaskTest",SerTaskStack
Do
Debug.Print Cstr(StatusTask(SerTaskStack))
Delay(2.0)
Loop
End Sub
Sub TaskTest()
Call WaitForInterrupt(&h1c, 0)
'Later code will go here to count
'pulses or transitions
Debug.Print "Task ran"
End Sub