|
|
| Author |
Message |
DH* Guest
|
|
Posted: 19 July 2006, 15:37 PM Post subject: What am I missing? |
|
|
This is my first stab at multitasking. My task stack is 50 bytes.
Just before starting my main loop I start the task with... | Code: | | CallTask TTLTask, TTLStack |
The task is... | Code: | Sub TTLTask()
Call WaitForInterrupt(zxPinChange, INT0) 'pin16 = ZC
cnt = cnt + 1
End Sub |
Pin16 has a square wave ZC from a TW523.
No matter how long the app runs, cnt never exceeds 1, indicating the task only gets called once.
Do I need to wrap the task procedure in a Do:Loop? |
|
| Back to top |
|
 |
mikep
Joined: 24 Sep 2005
Posts: 765
Location: Austin, TX
|
|
Posted: 19 July 2006, 15:54 PM Post subject: Re: What am I missing? |
|
|
| dhouston wrote: | | Code: | Sub TTLTask()
Call WaitForInterrupt(zxPinChange, INT0) 'pin16 = ZC
cnt = cnt + 1
End Sub |
| The End Sub effectively ends the task. So yes you do need some kind of loop if you want the task to do more work. |
|
| Back to top |
|
 |
DH* Guest
|
|
Posted: 19 July 2006, 17:33 PM Post subject: Re: What am I missing? |
|
|
| mikep wrote: | | The End Sub effectively ends the task. So yes you do need some kind of loop if you want the task to do more work. | Thanks - it works as expected with a loop. |
|
| Back to top |
|
 |
|